Skip to content

Commit

Permalink
Merge pull request #648 from cloudflare/jspspike/workerd-version
Browse files Browse the repository at this point in the history
Bump versions to `3.20230807.0`
  • Loading branch information
jspspike authored Aug 8, 2023
2 parents 4f7c955 + 5aad29b commit cf080a8
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 69 deletions.
104 changes: 52 additions & 52 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@miniflare/root",
"version": "3.20230801.1",
"version": "3.20230807.0",
"private": true,
"description": "Fun, full-featured, fully-local simulator for Cloudflare Workers",
"keywords": [
Expand Down
4 changes: 2 additions & 2 deletions packages/miniflare/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "miniflare",
"version": "3.20230801.1",
"version": "3.20230807.0",
"description": "Fun, full-featured, fully-local simulator for Cloudflare Workers",
"keywords": [
"cloudflare",
Expand Down Expand Up @@ -39,7 +39,7 @@
"source-map-support": "0.5.21",
"stoppable": "^1.1.0",
"undici": "^5.13.0",
"workerd": "1.20230801.0",
"workerd": "1.20230807.0",
"ws": "^8.11.0",
"youch": "^3.2.2",
"zod": "^3.20.6"
Expand Down
27 changes: 13 additions & 14 deletions packages/miniflare/src/plugins/queues/gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,17 @@ const DEFAULT_BATCH_TIMEOUT = 1; // second
const DEFAULT_RETRIES = 2;

// https://github.com/cloudflare/workerd/blob/01b87642f4eac932aa9074d7e5eec4fd3c90968a/src/workerd/io/outcome.capnp
const Outcome = {
UNKNOWN: 0,
OK: 1,
EXCEPTION: 2,
EXCEEDED_CPU: 3,
KILL_SWITCH: 4,
DAEMON_DOWN: 5,
SCRIPT_NOT_FOUND: 6,
CANCELED: 7,
EXCEEDED_MEMORY: 8,
} as const;
const OutcomeSchema = z.nativeEnum(Outcome);
const OutcomeSchema = z.enum([
"unknown",
"ok",
"exception",
"exceededCpu",
"killSwitch",
"daemonDown",
"scriptNotFound",
"cancelled",
"exceededMemory",
]);

const QueueResponseSchema = z.object({
outcome: OutcomeSchema,
Expand All @@ -37,7 +36,7 @@ const QueueResponseSchema = z.object({
});
type QueueResponse = z.infer<typeof QueueResponseSchema>;
const exceptionQueueResponse: QueueResponse = {
outcome: Outcome.EXCEPTION,
outcome: "exception",
retryAll: false,
ackAll: false,
explicitRetries: [],
Expand Down Expand Up @@ -153,7 +152,7 @@ export class QueuesGateway {

// Get messages to retry. If dispatching the batch failed for any reason,
// retry all messages.
const retryAll = response.retryAll || response.outcome !== Outcome.OK;
const retryAll = response.retryAll || response.outcome !== "ok";
const explicitRetries = new Set(response.explicitRetries);

let failedMessages = 0;
Expand Down

0 comments on commit cf080a8

Please sign in to comment.