update: add telegram logger
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user