mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 17:46:45 +00:00
fix(core): Separate error handlers for main and worker (#11091)
This commit is contained in:
@@ -203,14 +203,6 @@ export class ScalingService {
|
||||
// #region Listeners
|
||||
|
||||
private registerListeners() {
|
||||
this.queue.on('error', (error: Error) => {
|
||||
if ('code' in error && error.code === 'ECONNREFUSED') return; // handled by RedisClientService.retryStrategy
|
||||
|
||||
this.logger.error('[ScalingService] Queue errored', { error });
|
||||
|
||||
throw error;
|
||||
});
|
||||
|
||||
const { instanceType } = this.instanceSettings;
|
||||
if (instanceType === 'main' || instanceType === 'webhook') {
|
||||
this.registerMainOrWebhookListeners();
|
||||
@@ -230,6 +222,8 @@ export class ScalingService {
|
||||
});
|
||||
|
||||
this.queue.on('error', (error: Error) => {
|
||||
if ('code' in error && error.code === 'ECONNREFUSED') return; // handled by RedisClientService.retryStrategy
|
||||
|
||||
if (error.message.includes('job stalled more than maxStalledCount')) {
|
||||
throw new MaxStalledCountError(error);
|
||||
}
|
||||
@@ -244,6 +238,8 @@ export class ScalingService {
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
this.logger.error('[ScalingService] Queue errored', { error });
|
||||
|
||||
throw error;
|
||||
});
|
||||
}
|
||||
@@ -252,6 +248,14 @@ export class ScalingService {
|
||||
* Register listeners on a `main` or `webhook` process for Bull queue events.
|
||||
*/
|
||||
private registerMainOrWebhookListeners() {
|
||||
this.queue.on('error', (error: Error) => {
|
||||
if ('code' in error && error.code === 'ECONNREFUSED') return; // handled by RedisClientService.retryStrategy
|
||||
|
||||
this.logger.error('[ScalingService] Queue errored', { error });
|
||||
|
||||
throw error;
|
||||
});
|
||||
|
||||
this.queue.on('global:progress', (_jobId: JobId, msg: unknown) => {
|
||||
if (!this.isPubSubMessage(msg)) return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user