call beforePerform before retrieving an instance of the job class

This commit is contained in:
Chris Boulton 2014-06-26 19:07:52 +10:00
parent 610c4dcdbf
commit 0327217907

View File

@ -186,10 +186,10 @@ class Resque_Job
*/ */
public function perform() public function perform()
{ {
$instance = $this->getInstance();
try { try {
Resque_Event::trigger('beforePerform', $this); Resque_Event::trigger('beforePerform', $this);
$instance = $this->getInstance();
if(method_exists($instance, 'setUp')) { if(method_exists($instance, 'setUp')) {
$instance->setUp(); $instance->setUp();
} }