Skip to content

runOnce doesn't get re-run on server restart #58

Description

@matt-aitken

If a runOnce task doesn't complete and your server goes down, it doesn't retry when the server is back up.

run: async (event, ctx) => {
    const { videoId } = event;
    const result = await ctx.runOnce(videoId, async (idempotencyKey) => {
      await new Promise((r) => setTimeout(r, 10000));
      return "finished";
    });
    return { result };
  }

This does not restart if I kill the server mid-way. It just console.logs this when the server is back up:
[trigger.dev] Run cldzype0* complete 🏃 [render-video]

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions