Last active
August 29, 2015 14:05
-
-
Save arturo-c/9f93f8bc4124be67098e to your computer and use it in GitHub Desktop.
Allow queueing but not performing php resque
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @file | |
* Contains Drupal\resque\PerformLockPlugin. | |
*/ | |
namespace Drupal\resque; | |
use Resque as Php_Resque; | |
use Resque_Job_DontPerform; | |
class PerformLockPlugin{ | |
function beforePerform($job) { | |
if (Php_Resque::redis()->exists($arguments['drupal_unique_key'])) { | |
throw new Resque_Job_DontPerform('Unique key conflict.'); | |
$job->recreate(); | |
} | |
} | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment