Skip to content

Commit

Permalink
Fixed docs to use proper event name
Browse files Browse the repository at this point in the history
Should be `exitFailed` NOT `exitFailure`
  • Loading branch information
tniswong authored and Justin Reagor committed Jan 18, 2018
1 parent c73f47f commit 7208e02
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/30-configuration/34-jobs.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ The job that's watching for the `stopping` event can take however long it wants

The `restarts` field is the number of times the process will be restarted if it exits. This field supports any non-negative numeric value (ex. `0` or `1`) or the strings `"unlimited"` or `"never"`. This value is optional and usually defaults to `"never"` (see the note below about the `interval` field for the exception).

It's important to understand how this field compares to the `when` field. A restart is run only when the job receives its own `exitSuccess` or `exitFailure` event. The `when` field is for triggering on other events. In the example below the `app` job is first started when the `db` job is `healthy`, but it will restart whenever it exits. Using `restarts` with the `each` option of `when` is not recommended because each time the `each` event triggers, it will spawn an `exec` that can restart after exit. In the case of unlimited restarts this would eventually use up all the resources in your container, so trying to use `restarts: "unlimited"` and `each` will return an error.
It's important to understand how this field compares to the `when` field. A restart is run only when the job receives its own `exitSuccess` or `exitFailed` event. The `when` field is for triggering on other events. In the example below the `app` job is first started when the `db` job is `healthy`, but it will restart whenever it exits. Using `restarts` with the `each` option of `when` is not recommended because each time the `each` event triggers, it will spawn an `exec` that can restart after exit. In the case of unlimited restarts this would eventually use up all the resources in your container, so trying to use `restarts: "unlimited"` and `each` will return an error.

```json5
jobs: [
Expand Down

0 comments on commit 7208e02

Please sign in to comment.