resque/resque — pull request #1017 by magec (2013-05-21 14:57:38+00:00)
Title: Bugfix/avoid deregistering when running at exit hooks

There is bug when using run_at_exit_hooks. Given that the exit syscall raises a SystemExit Exception in ruby, its exit is treated as a failure, thus deregistering the worker. This patch solves this.

On the other hand, the thing is that (IMO), a failling child should not deregister its parent ever, and now, given that they both share the same exception handler it's this case can happend. I guess the exceptions should be handled in the child side in a similar way of that of the parent. With the current code the worker gets unregistered but accepting more jobs. I can file a fix for the broarder case, this one is just to fix the feature of run_at_exit_hooks.