Commit b41cdd9 1 parent 9aad545 commit b41cdd9 Copy full SHA for b41cdd9
File tree 1 file changed +13
-14
lines changed
packages/miniflare/src/plugins/queues
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
14
14
const DEFAULT_RETRIES = 2 ;
15
15
16
16
// 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
+ ] ) ;
29
28
30
29
const QueueResponseSchema = z . object ( {
31
30
outcome : OutcomeSchema ,
@@ -37,7 +36,7 @@ const QueueResponseSchema = z.object({
37
36
} ) ;
38
37
type QueueResponse = z . infer < typeof QueueResponseSchema > ;
39
38
const exceptionQueueResponse : QueueResponse = {
40
- outcome : Outcome . EXCEPTION ,
39
+ outcome : "exception" ,
41
40
retryAll : false ,
42
41
ackAll : false ,
43
42
explicitRetries : [ ] ,
@@ -153,7 +152,7 @@ export class QueuesGateway {
153
152
154
153
// Get messages to retry. If dispatching the batch failed for any reason,
155
154
// retry all messages.
156
- const retryAll = response . retryAll || response . outcome !== Outcome . OK ;
155
+ const retryAll = response . retryAll || response . outcome !== "ok" ;
157
156
const explicitRetries = new Set ( response . explicitRetries ) ;
158
157
159
158
let failedMessages = 0 ;
You can’t perform that action at this time.
0 commit comments