mirror of
				https://codeberg.org/yeentown/barkey.git
				synced 2025-11-03 23:14:13 +00:00 
			
		
		
		
	rethrow everything but non-retryable HTTP errors
every job that ends without an exception will be considered "completed" and not retried
This commit is contained in:
		
							parent
							
								
									5eca807e19
								
							
						
					
					
						commit
						e4047b4076
					
				
					 1 changed files with 2 additions and 11 deletions
				
			
		| 
						 | 
				
			
			@ -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,17 +244,9 @@ export class InboxProcessorService implements OnApplicationShutdown {
 | 
			
		|||
				}
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			if (e instanceof StatusError) {
 | 
			
		||||
				if (e.isRetryable) {
 | 
			
		||||
					return `temporary error ${e.statusCode}`;
 | 
			
		||||
				} else {
 | 
			
		||||
			if (e instanceof StatusError && !e.isRetryable) {
 | 
			
		||||
				return `skip: permanent error ${e.statusCode}`;
 | 
			
		||||
			}
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			if (e instanceof AbortError) {
 | 
			
		||||
				return 'request aborted';
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			throw e;
 | 
			
		||||
		}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue