benmanns / goworker

goworker is a Go-based background worker that runs 10 to 100,000* times faster than Ruby-based workers.
https://www.goworker.org
Other
2.79k stars 241 forks source link

Added error handling to Work #60

Closed jpatters closed 6 years ago

jpatters commented 6 years ago

Without this, Work() would only return an error in strange and somewhat irrelevant scenarios (ie, can't get the os hostname, or can't get a logger). It failed to catch if there was actually an error with the poller connecting to redis. This adds error handling so that Work() will actually return an error if the poller can't connect to redis, instead of just logging it out. This allowed me to implement some smart retry logic in the app I am working on. Did not fix tests as there is no mock for redis included and the tests seem to rely on this error not being handled properly.

benmanns commented 6 years ago

Thanks @jpatters!