mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-07-07 12:36:57 +00:00
ensure that permanent errors always terminate the inbox job
This commit is contained in:
parent
d53ff4097a
commit
1c48d3eef9
1 changed files with 9 additions and 0 deletions
|
@ -31,6 +31,7 @@ import { SkApInboxLog } from '@/models/_.js';
|
||||||
import type { Config } from '@/config.js';
|
import type { Config } from '@/config.js';
|
||||||
import { ApLogService, calculateDurationSince } from '@/core/ApLogService.js';
|
import { ApLogService, calculateDurationSince } from '@/core/ApLogService.js';
|
||||||
import { UpdateInstanceQueue } from '@/core/UpdateInstanceQueue.js';
|
import { UpdateInstanceQueue } from '@/core/UpdateInstanceQueue.js';
|
||||||
|
import { isRetryableError } from '@/misc/is-retryable-error.js';
|
||||||
import { QueueLoggerService } from '../QueueLoggerService.js';
|
import { QueueLoggerService } from '../QueueLoggerService.js';
|
||||||
import type { InboxJobData } from '../types.js';
|
import type { InboxJobData } from '../types.js';
|
||||||
|
|
||||||
|
@ -312,6 +313,14 @@ export class InboxProcessorService implements OnApplicationShutdown {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isRetryableError(e)) {
|
||||||
|
if (e instanceof Error) {
|
||||||
|
return `skip: permanent error ${e.name}: ${e.message}`;
|
||||||
|
} else {
|
||||||
|
return `skip: permanent error ${e}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
return 'ok';
|
return 'ok';
|
||||||
|
|
Loading…
Add table
Reference in a new issue