1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-03 17:59:37 +02:00

Avoid "No changed keys found" error

This commit is contained in:
Chocobozzz 2024-08-19 10:13:33 +02:00
parent c5b66526eb
commit 3a6e3c9dee
No known key found for this signature in database
GPG key ID: 583A612D890159BE
2 changed files with 1 additions and 4 deletions

View file

@ -69,8 +69,7 @@ function transactionRetryer <T> (func: (err: any, data: T) => any) {
}
function saveInTransactionWithRetries <T extends Pick<Model, 'save' | 'changed'>> (model: T) {
const changedKeys = model.changed()
if (!changedKeys) throw new Error('No changed keys found')
const changedKeys = model.changed() || []
return retryTransactionWrapper(() => {
return sequelizeTypescript.transaction(async transaction => {