Avoid "No changed keys found" error
This commit is contained in:
parent
c5b66526eb
commit
3a6e3c9dee
|
@ -69,8 +69,7 @@ function transactionRetryer <T> (func: (err: any, data: T) => any) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function saveInTransactionWithRetries <T extends Pick<Model, 'save' | 'changed'>> (model: T) {
|
function saveInTransactionWithRetries <T extends Pick<Model, 'save' | 'changed'>> (model: T) {
|
||||||
const changedKeys = model.changed()
|
const changedKeys = model.changed() || []
|
||||||
if (!changedKeys) throw new Error('No changed keys found')
|
|
||||||
|
|
||||||
return retryTransactionWrapper(() => {
|
return retryTransactionWrapper(() => {
|
||||||
return sequelizeTypescript.transaction(async transaction => {
|
return sequelizeTypescript.transaction(async transaction => {
|
||||||
|
|
|
@ -287,8 +287,6 @@ export class UserExporter {
|
||||||
|
|
||||||
this.archive.on('entry', entryListener)
|
this.archive.on('entry', entryListener)
|
||||||
|
|
||||||
logger.error('Adding stream ' + archivePath)
|
|
||||||
|
|
||||||
// Prevent sending a stream that has an error on open resulting in a stucked archiving process
|
// Prevent sending a stream that has an error on open resulting in a stucked archiving process
|
||||||
stream.once('readable', () => {
|
stream.once('readable', () => {
|
||||||
if (errored) return
|
if (errored) return
|
||||||
|
|
Loading…
Reference in New Issue