-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Event listener support for Resque's Event/Hook System #84
Comments
Create a require_once __DIR__ . '/bootstrap.php.cache';
Resque_Event::listen('beforeFork', function(Resque_Job $job) {
}); And then start the worker manually using:
|
@ruudk How am I suppose to access the Service Container to get access to the logger service within my worker_bootstrap.php? Also, does this make the worker run in the 'prod' environment? |
You should prepend There is already support for onFailure (auto retry + logging), see: https://github.com/michelsalib/BCCResqueBundle/blob/master/bin/resque#L67 |
@ruudk looks like we need to add ENVIRONMENT='prod' in the README file. Presently its just blank :-S
Why is it just Checking the onFailure (auto retry + logging) |
Oh, you mean it needs to be
? |
@ruudk I don't see the usage of the ENVIRONMENT variable anywhere in the code base.. :-S Shouldn't it be by default in production environment? |
Run the job with
|
I came across the same requirement in order to implement new relic logging. I have to admit, this is not really the most beatiful solution and I think there should be a more integrated way in order to hook into resque events. In my specific case I would really need the container, since I want to log execution times to new relic. And I would like to access my newRelic handler from the container. Is there already a new approach to this? |
If a job fails due to an exception, I want to log an entry using Monolog. How am I supposed to listen to job failure events with this bundle?
The PHP Resque library supports an Event/Hook System.. what is the recommended approach while using this bundle?
The text was updated successfully, but these errors were encountered: