prevents workers to stale when redis server went away
fix for #180
unfortunatelly I have no clue, why the first access on redis()->ping() does not throw the exception anyhow this will prevent worker from getting useless after a network failure or redis restart
Throwing a CredisException instead of duplicating the error handling code would probably be a good idea.
That said, it's interesting that Credis itself doesn't handle this... The reason we don't is it's supposed to do it for us.
I've updated the pull according to your comment
Looks good to me.
I still find it odd that Credis doesn't handle that on its own, though. I wonder if it's handled correctly in a more recent version of the library...
any chance that this pull requests gets merged?
I had to update the commit due to missing constructor message on CredisException
:+1:
I think in theory this should also be covered by #229, which was just merged down - essentially, the next operation against Redis on an instance that's gone away will cause the worker to throw an exception (Resque_RedisException)