Skip to content

Commit

Permalink
Clarify error handling in readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
nickelser committed Sep 9, 2016
1 parent 0586bcf commit 66f61cb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ end

## Error handling

As Caddy refreshers are run in threads, exceptions are not normally reported (except by default in the logs). To add a programmatic error handler:
As Caddy refreshers are run in threads, exceptions are not normally reported (except by default in the logs). If your refresher errors out (or times out, which can happen if your refresher takes as long as your refresh interval to run) your error handler will be called and the cache value will remain what it was before it errored. This means your application may use stale values until your refresher stops erroring.

To add a programmatic error handler:

```ruby
Caddy[:flags].refresher = -> { SomeFlagService.fetch_flags }
Expand Down

0 comments on commit 66f61cb

Please sign in to comment.