-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathengine.v1.dev.dequeue.ts
More file actions
22 lines (19 loc) · 772 Bytes
/
engine.v1.dev.dequeue.ts
File metadata and controls
22 lines (19 loc) · 772 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { json } from "@remix-run/server-runtime";
import { DevDequeueRequestBody } from "@trigger.dev/core/v3";
import { createActionApiRoute } from "~/services/routeBuilders/apiBuilder.server";
import { engine } from "~/v3/runEngine.server";
const { action } = createActionApiRoute(
{
body: DevDequeueRequestBody, // Even though we don't use it, we need to keep it for backwards compatibility
maxContentLength: 1024 * 10, // 10KB
method: "POST",
},
async ({ authentication }) => {
const dequeuedMessages = await engine.dequeueFromEnvironmentWorkerQueue({
consumerId: authentication.environment.id,
environmentId: authentication.environment.id,
});
return json({ dequeuedMessages }, { status: 200 });
}
);
export { action };