diff --git a/src/main.ts b/src/main.ts index af47f96..bf45c8b 100644 --- a/src/main.ts +++ b/src/main.ts @@ -28,7 +28,6 @@ async function bootstrap() { `) ); - await app.get(SqsPosterWorker).start(); } diff --git a/src/sqs-module/sqs.poster.worker.ts b/src/sqs-module/sqs.poster.worker.ts index c3cc997..58a2f11 100644 --- a/src/sqs-module/sqs.poster.worker.ts +++ b/src/sqs-module/sqs.poster.worker.ts @@ -25,13 +25,12 @@ export class SqsPosterWorker { await this.notifyService.sendMessageToTele(`🚀 Worker started for ${await this.sqs.getQueueName()}`) //check cookie - if (!await this.xCacheService.isXCookiesAlive()) { - this.xRouterService.verifyCookie().catch((err) => { - console.error(`SqsPosterWorker_verifyCookie`); - console.error(err); - }); - - } + this.xCacheService.isXCookiesAlive().then(isLive => { + this.logger.log(`cache cookie is ${isLive ? 'LIVE' : 'DIE'}`); + if (!isLive) { + this.xRouterService.verifyCookie(); + } + }); let ReceiptHandle = ''; while (true) {