Open nCrafts opened 1 year ago
:wave:
This is a minimal example to auto start a process and restart it on crash - does this work @nCrafts ?:
https://github.com/Hexagon/pup/blob/main/docs/src/examples/minimal/pup.jsonc
{
"processes": [
{
"id": "forever",
"cmd": "deno run --allow-env server.js",
"autostart": true,
"restart": "always"
}
]
}
I see. That works. If I have --watch in the cmd it fails, but if I remove that and use the built in pup's watch it works as expected. Is that expected?
Nice!
I have not considered Deno's built in watcher, will have to have a look at that. Let's leave this issue open until then 👍
Thank you so much! Also I noticed that when I am running it on a mac with the watch configuration enabled I can't seem to exit using ctrl + c. It does terminate the processes but the watcher keeps running. Any tips?
Open a separate issue describing that, and we'll figure it out from there. I have no mac at hand, but signals are handled specifically so it's most probably a Pup issue.
I am trying to understand better how crash works. If my service crashes owing to an uncaught error is there a way to restart it? I simulated this scenario using
And setting restart to "always" but it only restarts on file changes.
Any tips? Thanks!