Perpetual Scripts in dev
Hey team! I'm looking to use perpetual scripts to run a job queue listener (similar to this example), but I'd like a clean way to disable it in my dev environment (don't want a perpetual worker constantly running locally).
Is there a recommended pattern for this? Ideally something like:
- A config flag or environment variable that prevents the perpetual script from starting
- Or a way to conditionally enable/disable perpetual scripts per environment
Currently considering just wrapping my listener in an env check, but I think I'll still run into the problem of the job just repeatedly restarting.
Thanks!
Is there a recommended pattern for this? Ideally something like:
- A config flag or environment variable that prevents the perpetual script from starting
- Or a way to conditionally enable/disable perpetual scripts per environment
Currently considering just wrapping my listener in an env check, but I think I'll still run into the problem of the job just repeatedly restarting.
Thanks!
Perpetual scripts restart upon ending unless canceled.