This repository was archived by the owner on Mar 13, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +13
-14
lines changed
packages/miniflare/src/plugins/queues Expand file tree Collapse file tree 1 file changed +13
-14
lines changed Original file line number Diff line number Diff line change @@ -14,18 +14,17 @@ const DEFAULT_BATCH_TIMEOUT = 1; // second
1414const DEFAULT_RETRIES = 2 ;
1515
1616// https://github.com/cloudflare/workerd/blob/01b87642f4eac932aa9074d7e5eec4fd3c90968a/src/workerd/io/outcome.capnp
17- const Outcome = {
18- UNKNOWN : 0 ,
19- OK : 1 ,
20- EXCEPTION : 2 ,
21- EXCEEDED_CPU : 3 ,
22- KILL_SWITCH : 4 ,
23- DAEMON_DOWN : 5 ,
24- SCRIPT_NOT_FOUND : 6 ,
25- CANCELED : 7 ,
26- EXCEEDED_MEMORY : 8 ,
27- } as const ;
28- const OutcomeSchema = z . nativeEnum ( Outcome ) ;
17+ const OutcomeSchema = z . enum ( [
18+ "unknown" ,
19+ "ok" ,
20+ "exception" ,
21+ "exceededCpu" ,
22+ "killSwitch" ,
23+ "daemonDown" ,
24+ "scriptNotFound" ,
25+ "cancelled" ,
26+ "exceededMemory" ,
27+ ] ) ;
2928
3029const QueueResponseSchema = z . object ( {
3130 outcome : OutcomeSchema ,
@@ -37,7 +36,7 @@ const QueueResponseSchema = z.object({
3736} ) ;
3837type QueueResponse = z . infer < typeof QueueResponseSchema > ;
3938const exceptionQueueResponse : QueueResponse = {
40- outcome : Outcome . EXCEPTION ,
39+ outcome : "exception" ,
4140 retryAll : false ,
4241 ackAll : false ,
4342 explicitRetries : [ ] ,
@@ -153,7 +152,7 @@ export class QueuesGateway {
153152
154153 // Get messages to retry. If dispatching the batch failed for any reason,
155154 // retry all messages.
156- const retryAll = response . retryAll || response . outcome !== Outcome . OK ;
155+ const retryAll = response . retryAll || response . outcome !== "ok" ;
157156 const explicitRetries = new Set ( response . explicitRetries ) ;
158157
159158 let failedMessages = 0 ;
You can’t perform that action at this time.
0 commit comments