refactor(core): Organize Redis under scaling mode (#10864)

This commit is contained in:
Iván Ovejero
2024-09-19 09:52:48 +02:00
committed by GitHub
parent 91008b2676
commit 69c6e0790d
24 changed files with 133 additions and 212 deletions

View File

@@ -24,7 +24,7 @@ import type {
JobStatus,
JobId,
QueueRecoveryContext,
PubSubMessage,
JobReport,
} from './scaling.types';
@Service()
@@ -46,7 +46,7 @@ export class ScalingService {
async setupQueue() {
const { default: BullQueue } = await import('bull');
const { RedisClientService } = await import('@/services/redis/redis-client.service');
const { RedisClientService } = await import('@/services/redis-client.service');
const service = Container.get(RedisClientService);
const bullPrefix = this.globalConfig.queue.bull.prefix;
@@ -265,7 +265,7 @@ export class ScalingService {
}
}
private isPubSubMessage(candidate: unknown): candidate is PubSubMessage {
private isPubSubMessage(candidate: unknown): candidate is JobReport {
return typeof candidate === 'object' && candidate !== null && 'kind' in candidate;
}