trigger.dev icon indicating copy to clipboard operation
trigger.dev copied to clipboard

Prevent multiple instance of the `dev` command running at the same time with a File lock

Open ericallam opened this issue 11 months ago • 0 comments

It's currently possible to run the dev command in multiple different sessions at the same time, which causes all sorts of issues, including:

  • Cannot find module dev-run-worker.mjs error
  • Some runs getting "stuck" while others work

We should add a "file lock" mechanism on the dev command to prevent this. This would create a file in .trigger/dev.lock with the pid of the dev CLI process and if it already exists, we would exit with a helpful message about how to recover from this issue (or even better, give an option to stop the other dev CLI process).

ericallam avatar Jan 13 '25 22:01 ericallam