ensure that permanent errors always terminate the inbox job

This commit is contained in:
Hazelnoot 2025-03-03 00:50:21 -05:00
parent d53ff4097a
commit 1c48d3eef9

View file

@ -31,6 +31,7 @@ import { SkApInboxLog } from '@/models/_.js';
import type { Config } from '@/config.js';
import { ApLogService, calculateDurationSince } from '@/core/ApLogService.js';
import { UpdateInstanceQueue } from '@/core/UpdateInstanceQueue.js';
import { isRetryableError } from '@/misc/is-retryable-error.js';
import { QueueLoggerService } from '../QueueLoggerService.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;
}
return 'ok';