mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-02-25 18:55:32 -06:00
Fix "Correctly save transaction with retries"
This commit is contained in:
@@ -76,11 +76,13 @@ function saveInTransactionWithRetries <T extends Pick<Model, 'save' | 'changed'>
|
||||
return sequelizeTypescript.transaction(async transaction => {
|
||||
try {
|
||||
await model.save({ transaction })
|
||||
} catch {
|
||||
} catch (err) {
|
||||
// Reinit changed keys
|
||||
for (const key of changedKeys) {
|
||||
model.changed(key as keyof Model, true)
|
||||
}
|
||||
|
||||
throw err
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user