Skip to content
Snippets Groups Projects
Commit e4047b40 authored by dakkar's avatar dakkar Committed by Hazelnoot
Browse files

rethrow everything but non-retryable HTTP errors

every job that ends without an exception will be considered
"completed" and not retried
parent 5eca807e
No related branches found
No related tags found
No related merge requests found
......@@ -7,7 +7,6 @@ import { URL } from 'node:url';
import { Inject, Injectable, OnApplicationShutdown } from '@nestjs/common';
import httpSignature from '@peertube/http-signature';
import * as Bull from 'bullmq';
import { AbortError } from 'node-fetch';
import type Logger from '@/logger.js';
import { FederatedInstanceService } from '@/core/FederatedInstanceService.js';
import { FetchInstanceMetadataService } from '@/core/FetchInstanceMetadataService.js';
......@@ -245,16 +244,8 @@ export class InboxProcessorService implements OnApplicationShutdown {
}
}
if (e instanceof StatusError) {
if (e.isRetryable) {
return `temporary error ${e.statusCode}`;
} else {
return `skip: permanent error ${e.statusCode}`;
}
}
if (e instanceof AbortError) {
return 'request aborted';
if (e instanceof StatusError && !e.isRetryable) {
return `skip: permanent error ${e.statusCode}`;
}
throw e;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment