resque/resque — pull request #1208 by Flauschbaellchen (2014-04-25 14:51:42+00:00)
Title: (Another) Fix for Redis::InheritedError

Today I stumpled over the Redis::InheritedError if starting a worker to the background.
> Redis::InheritedError: Tried to use a connection from a child process without reconnecting. You need to reconnect to Redis after forking

There are already *many* fixes out there, but none of them worked for me.
My favorited solution was to add
```
Resque.before_first_fork do
Resque.redis.client.reconnect
end
```
(or using #before_fork callback) to my initializer.
However, the error still occurred everythime and after some debugging I found that in #prune_dead_workers (within #startup) Resque already tried to call Workers.all which leads to Resque.redis/@redis.
But because there was no reconnect yet, the error popped in.
After the small change the workaround mentioned above worked.
Any comments on this, e.g. if there was a reason why the hook was called below prune_dead_workers and not before?