@@ -7,6 +7,8 @@ import { singleton } from "~/utils/singleton";
7
7
import { DeliverAlertService } from "./services/alerts/deliverAlert.server" ;
8
8
import { PerformDeploymentAlertsService } from "./services/alerts/performDeploymentAlerts.server" ;
9
9
import { PerformTaskRunAlertsService } from "./services/alerts/performTaskRunAlerts.server" ;
10
+ import { ExpireEnqueuedRunService } from "./services/expireEnqueuedRun.server" ;
11
+ import { EnqueueDelayedRunService } from "./services/enqueueDelayedRun.server" ;
10
12
11
13
function initializeWorker ( ) {
12
14
const redisOptions = {
@@ -52,6 +54,24 @@ function initializeWorker() {
52
54
maxAttempts : 3 ,
53
55
} ,
54
56
} ,
57
+ "v3.expireRun" : {
58
+ schema : z . object ( {
59
+ runId : z . string ( ) ,
60
+ } ) ,
61
+ visibilityTimeoutMs : 60_000 ,
62
+ retry : {
63
+ maxAttempts : 6 ,
64
+ } ,
65
+ } ,
66
+ "v3.enqueueDelayedRun" : {
67
+ schema : z . object ( {
68
+ runId : z . string ( ) ,
69
+ } ) ,
70
+ visibilityTimeoutMs : 60_000 ,
71
+ retry : {
72
+ maxAttempts : 6 ,
73
+ } ,
74
+ } ,
55
75
} ,
56
76
concurrency : {
57
77
workers : env . COMMON_WORKER_CONCURRENCY_WORKERS ,
@@ -65,16 +85,26 @@ function initializeWorker() {
65
85
"v3.deliverAlert" : async ( { payload } ) => {
66
86
const service = new DeliverAlertService ( ) ;
67
87
68
- return await service . call ( payload . alertId ) ;
88
+ await service . call ( payload . alertId ) ;
69
89
} ,
70
90
"v3.performDeploymentAlerts" : async ( { payload } ) => {
71
91
const service = new PerformDeploymentAlertsService ( ) ;
72
92
73
- return await service . call ( payload . deploymentId ) ;
93
+ await service . call ( payload . deploymentId ) ;
74
94
} ,
75
95
"v3.performTaskRunAlerts" : async ( { payload } ) => {
76
96
const service = new PerformTaskRunAlertsService ( ) ;
77
- return await service . call ( payload . runId ) ;
97
+ await service . call ( payload . runId ) ;
98
+ } ,
99
+ "v3.expireRun" : async ( { payload } ) => {
100
+ const service = new ExpireEnqueuedRunService ( ) ;
101
+
102
+ await service . call ( payload . runId ) ;
103
+ } ,
104
+ "v3.enqueueDelayedRun" : async ( { payload } ) => {
105
+ const service = new EnqueueDelayedRunService ( ) ;
106
+
107
+ await service . call ( payload . runId ) ;
78
108
} ,
79
109
} ,
80
110
} ) ;
0 commit comments