update: add telegram logger

This commit is contained in:
mahyargdz
2025-05-23 19:06:44 +03:30
parent b5c90e8c2e
commit e03f95a17a
3 changed files with 5 additions and 8 deletions
@@ -44,18 +44,15 @@ export class NotificationProcessor extends WorkerProcessor {
}
async process(job: Job<NotificationJobData | OtpJobData>, token?: string) {
this.logger.log(`Processing notification job: ${job.id} ${token ? `with token: ${token}` : ""}`);
this.logger.log(`Processing notification job: ${job.name} ${token ? `with token: ${token}` : ""}`);
const queryRunner = this.dataSource.createQueryRunner();
let heartbeat: NodeJS.Timeout | undefined;
//
try {
await queryRunner.connect();
await queryRunner.startTransaction();
heartbeat = setInterval(() => job.updateProgress(50), 10000);
//
if (job.name === NOTIFICATION.SEND_LOGIN_OTP_JOB_NAME) {
const { phone, code } = job.data as OtpJobData;
await this.smsService.sendSmsVerifyCode(phone, code);