File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed
packages/apps/job-launcher/server/src/modules Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -342,7 +342,7 @@ export class CronJobService {
342342 try {
343343 const webhookEntities = await this . webhookRepository . findByStatusAndType (
344344 WebhookStatus . PENDING ,
345- EventType . ESCROW_CREATED ,
345+ [ EventType . ESCROW_CREATED , EventType . ESCROW_CANCELED ] ,
346346 ) ;
347347
348348 for ( const webhookEntity of webhookEntities ) {
Original file line number Diff line number Diff line change 11import { Injectable , Logger } from '@nestjs/common' ;
22
33import { BaseRepository } from '../../database/base.repository' ;
4- import { DataSource , LessThanOrEqual } from 'typeorm' ;
4+ import { DataSource , In , LessThanOrEqual } from 'typeorm' ;
55import { ServerConfigService } from '../../common/config/server-config.service' ;
66import { EventType , WebhookStatus } from '../../common/enums/webhook' ;
77import { WebhookEntity } from './webhook.entity' ;
@@ -17,12 +17,13 @@ export class WebhookRepository extends BaseRepository<WebhookEntity> {
1717 }
1818 public findByStatusAndType (
1919 status : WebhookStatus ,
20- type : EventType ,
20+ type : EventType | EventType [ ] ,
2121 ) : Promise < WebhookEntity [ ] > {
22+ const typeClause = ! Array . isArray ( type ) ? [ type ] : type ;
2223 return this . find ( {
2324 where : {
2425 status : status ,
25- eventType : type ,
26+ eventType : In ( typeClause ) ,
2627 retriesCount : LessThanOrEqual ( this . serverConfigService . maxRetryCount ) ,
2728 waitUntil : LessThanOrEqual ( new Date ( ) ) ,
2829 } ,
You can’t perform that action at this time.
0 commit comments