diff options
author | Chocobozzz <me@florianbigard.com> | 2021-06-09 13:31:22 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-06-09 13:31:22 +0200 |
commit | a6a12dae10658a1fa7120ad39702c07137143954 (patch) | |
tree | 81b6b6663541f6120918a696569c1083b5bd30b6 | |
parent | 5d6395af72e01ba7c4393b485b7089bcb33e0155 (diff) | |
download | PeerTube-a6a12dae10658a1fa7120ad39702c07137143954.tar.gz PeerTube-a6a12dae10658a1fa7120ad39702c07137143954.tar.zst PeerTube-a6a12dae10658a1fa7120ad39702c07137143954.zip |
Fix run committed transation
-rw-r--r-- | server/helpers/database-utils.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/server/helpers/database-utils.ts b/server/helpers/database-utils.ts index 240b18033..b5dc70c17 100644 --- a/server/helpers/database-utils.ts +++ b/server/helpers/database-utils.ts | |||
@@ -108,7 +108,9 @@ function setAsUpdated (table: string, id: number, transaction?: Transaction) { | |||
108 | // --------------------------------------------------------------------------- | 108 | // --------------------------------------------------------------------------- |
109 | 109 | ||
110 | function runInReadCommittedTransaction <T> (fn: (t: Transaction) => Promise<T>) { | 110 | function runInReadCommittedTransaction <T> (fn: (t: Transaction) => Promise<T>) { |
111 | return sequelizeTypescript.transaction(t => fn(t)) | 111 | const options = { isolationLevel: Transaction.ISOLATION_LEVELS.READ_COMMITTED } |
112 | |||
113 | return sequelizeTypescript.transaction(options, t => fn(t)) | ||
112 | } | 114 | } |
113 | 115 | ||
114 | function afterCommitIfTransaction (t: Transaction, fn: Function) { | 116 | function afterCommitIfTransaction (t: Transaction, fn: Function) { |