1
0
Fork 0

Fix run committed transation

This commit is contained in:
Chocobozzz 2021-06-09 13:31:22 +02:00
parent 5d6395af72
commit a6a12dae10
No known key found for this signature in database
GPG key ID: 583A612D890159BE

View file

@ -108,7 +108,9 @@ function setAsUpdated (table: string, id: number, transaction?: Transaction) {
// ---------------------------------------------------------------------------
function runInReadCommittedTransaction <T> (fn: (t: Transaction) => Promise<T>) {
return sequelizeTypescript.transaction(t => fn(t))
const options = { isolationLevel: Transaction.ISOLATION_LEVELS.READ_COMMITTED }
return sequelizeTypescript.transaction(options, t => fn(t))
}
function afterCommitIfTransaction (t: Transaction, fn: Function) {