removed dangerous code

This commit is contained in:
Ulf Gebhardt 2021-11-04 18:08:59 +01:00
parent d15b9a7e3c
commit 854ce12d62
Signed by: ulfgebhardt
GPG Key ID: DA6B843E748679C9

View File

@ -394,9 +394,11 @@ export class UserResolver {
await queryRunner.commitTransaction()
} catch (e) {
await queryRunner.rollbackTransaction()
await rollbackAutoIncrement(queryRunner, LoginUser, `login_users`)
await rollbackAutoIncrement(queryRunner, LoginUserBackup, `login_user_backups`)
await rollbackAutoIncrement(queryRunner, DbUser, `state_users`)
// TODO: Lets not do this?! What if state_users were never updated?
// We would still roll back the autoincrement which would produce duplicate entries?!
// await rollbackAutoIncrement(queryRunner, LoginUser, `login_users`)
// await rollbackAutoIncrement(queryRunner, LoginUserBackup, `login_user_backups`)
// await rollbackAutoIncrement(queryRunner, DbUser, `state_users`)
throw e
} finally {
await queryRunner.release()
@ -573,6 +575,7 @@ export class UserResolver {
}
}
/*
const rollbackAutoIncrement = async (
queryRunner: QueryRunner,
entity: typeof BaseEntity,
@ -588,3 +591,4 @@ const rollbackAutoIncrement = async (
throw new Error('Problems with reset auto increment: ' + error)
})
}
*/