|
|
|
@ -27,7 +27,7 @@ export class OldDBFilesService {
@@ -27,7 +27,7 @@ export class OldDBFilesService {
|
|
|
|
|
|
|
|
|
|
private async copyFiles(attempt = 0) { |
|
|
|
|
const oldFiles = await this.getOldFiles() |
|
|
|
|
console.log('attempt № ', attempt, 'files to save', oldFiles.length) |
|
|
|
|
|
|
|
|
|
if (_.isEmpty(oldFiles) || attempt > 10) return |
|
|
|
|
|
|
|
|
|
for await (const oldFile of oldFiles) { |
|
|
|
@ -35,7 +35,7 @@ export class OldDBFilesService {
@@ -35,7 +35,7 @@ export class OldDBFilesService {
|
|
|
|
|
await this.loadAndSaveFile(oldFile) |
|
|
|
|
await this.oldDbFilesRepository.delete(oldFile.id) |
|
|
|
|
} catch (e) { |
|
|
|
|
console.log(e) |
|
|
|
|
console.log('Error on copy file', oldFile, e) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|