Running a service
A service is a command that should keep running: a queue worker, a bot, a small server. RunWisp starts it with the daemon and starts it again when it exits.
[services.worker]instances = 3 # keep three copies runningrun = "node /app/worker.js"Run runwisp reload and the three copies start.
Follow its output
Section titled “Follow its output”runwisp logs -f workerEach line starts with the copy it came from (worker#2 | ...). Every start of a
copy is a run in the history, so when one crashes, its output and exit code
stay behind for you to read.
Task or service?
Section titled “Task or service?”If the command exits on its own when it’s done, it’s a task. If it runs until
you stop it, it’s a service. A script that loops forever with a sleep inside
is usually better as a task on a schedule; see
A polling loop.
When it keeps crashing
Section titled “When it keeps crashing”A service that exits right after it starts is restarted with a growing delay. After too many failed starts in a row, RunWisp stops trying and alerts you like a failed task. See When a service can’t start.
Next steps
Section titled “Next steps”- Tasks and services compares the two in full.
- Every key a service accepts is in the
[services.*]reference.