Browse Source

Merge branch 'old-db/console-error' into 'stage'

CHORE | Console old entity on save it to DB failed

See merge request jetup/rws/api-rws!236
merge-requests/237/head
Coder 2 years ago
parent
commit
cd8249c41b
  1. 2
      src/domain/old-database-seed/services/factories.service.ts
  2. 4
      src/domain/old-database-seed/services/files.service.ts
  3. 2
      src/domain/old-database-seed/services/permissions-groups.service.ts
  4. 6
      src/domain/old-database-seed/services/tasks-comments.service.ts
  5. 2
      src/domain/old-database-seed/services/tasks-documents.service.ts
  6. 2
      src/domain/old-database-seed/services/tasks.service.ts
  7. 2
      src/domain/old-database-seed/services/taxonomies.service.ts
  8. 2
      src/domain/old-database-seed/services/users-relations.service.ts
  9. 2
      src/domain/old-database-seed/services/users.service.ts

2
src/domain/old-database-seed/services/factories.service.ts

@ -38,7 +38,7 @@ export class OldDBFactoriesService { @@ -38,7 +38,7 @@ export class OldDBFactoriesService {
const isSuccess = await this.saveFactory(oldFactory)
if (!isSuccess) unsaved.push(oldFactory)
} catch (e) {
console.log(e)
console.log('Error on save factory', oldFactory, e)
unsaved.push(oldFactory)
}
}

4
src/domain/old-database-seed/services/files.service.ts

@ -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)
}
}

2
src/domain/old-database-seed/services/permissions-groups.service.ts

@ -25,7 +25,7 @@ export class OldDBPermissionsGroupsService { @@ -25,7 +25,7 @@ export class OldDBPermissionsGroupsService {
try {
await this.savePermissionsGroup(oldGroup)
} catch (e) {
console.log(e)
console.log('Error on save permissions group', oldGroup, e)
}
}
}

6
src/domain/old-database-seed/services/tasks-comments.service.ts

@ -31,17 +31,13 @@ export class OldDBTasksCommentsService { @@ -31,17 +31,13 @@ export class OldDBTasksCommentsService {
public async run() {
const oldComments = await this.getOldComments()
console.log('OLD COMMENTS', oldComments.length)
const newUsersIds = await this.getNewEntitiesIds(OldDbRelationType.Users)
console.log('NEW USERS IDS', newUsersIds)
for await (const oldComment of oldComments) {
try {
console.log('comment', oldComment.id)
await this.saveComment(oldComment, newUsersIds)
} catch (e) {
console.log(e)
console.log('Error on save comment', oldComment, e)
}
}
}

2
src/domain/old-database-seed/services/tasks-documents.service.ts

@ -40,7 +40,7 @@ export class OldDBTasksDocumentsService { @@ -40,7 +40,7 @@ export class OldDBTasksDocumentsService {
try {
await this.saveDocument(oldDocument)
} catch (e) {
console.log(e)
console.log('Error on save document', oldDocument, e)
}
}

2
src/domain/old-database-seed/services/tasks.service.ts

@ -35,7 +35,7 @@ export class OldDBTasksService { @@ -35,7 +35,7 @@ export class OldDBTasksService {
try {
await this.saveTask(oldTask)
} catch (e) {
console.log(e)
console.log('Error on save task', oldTask, e)
}
}

2
src/domain/old-database-seed/services/taxonomies.service.ts

@ -49,7 +49,7 @@ export class OldDBTaxonomiesService { @@ -49,7 +49,7 @@ export class OldDBTaxonomiesService {
const isSuccess = await this.saveTaxonomy(oldTaxonomy)
if (!isSuccess) unsaved.push(oldTaxonomy)
} catch (e) {
console.log(e)
console.log('Error on save taxonomy', oldTaxonomy, e)
unsaved.push(oldTaxonomy)
}
}

2
src/domain/old-database-seed/services/users-relations.service.ts

@ -29,7 +29,7 @@ export class OldDBUsersRelationsService { @@ -29,7 +29,7 @@ export class OldDBUsersRelationsService {
try {
await this.saveUserRelations(oldUser)
} catch (e) {
console.log(e)
console.log('Error on save user relations for user', oldUser, e)
}
}
}

2
src/domain/old-database-seed/services/users.service.ts

@ -36,7 +36,7 @@ export class OldDBUsersService { @@ -36,7 +36,7 @@ export class OldDBUsersService {
try {
await this.saveUser(oldUser)
} catch (e) {
console.log(e)
console.log('Error on save user', oldUser, e)
}
}
}

Loading…
Cancel
Save