refactor: Add log messages to debug worker init issues (#7238)

Github issue / Community forum post (link here to close automatically):
This commit is contained in:
Omar Ajoue
2023-10-05 13:37:25 +02:00
committed by GitHub
parent 169175080a
commit 5cfd87692f
3 changed files with 22 additions and 1 deletions

View File

@@ -263,13 +263,19 @@ export class Worker extends BaseCommand {
await super.init();
await this.initLicense();
this.logger.debug('License init complete');
await this.initBinaryDataService();
this.logger.debug('Binary data service init complete');
await this.initExternalHooks();
this.logger.debug('External hooks init complete');
await this.initExternalSecrets();
this.logger.debug('External secrets init complete');
await this.initEventBus();
this.logger.debug('Event bus init complete');
await this.initRedis();
this.logger.debug('Redis init complete');
await this.initQueue();
this.logger.debug('Queue init complete');
}
async initEventBus() {
@@ -315,8 +321,13 @@ export class Worker extends BaseCommand {
const redisConnectionTimeoutLimit = config.getEnv('queue.bull.redis.timeoutThreshold');
this.logger.debug(
`Opening Redis connection to listen to messages with timeout ${redisConnectionTimeoutLimit}`,
);
const queue = Container.get(Queue);
await queue.init();
this.logger.debug('Queue singleton ready');
Worker.jobQueue = queue.getBullObjectInstance();
void Worker.jobQueue.process(flags.concurrency, async (job) =>
this.runJob(job, this.nodeTypes),