Merge pull request #6037 from colemanw/CRM-16512
[civicrm-core.git] / bin / ContributionProcessor.php
index 45bd0b52292526d39e87f593249b0451be262309..57abe9cb453e98d34da76ca480299392f447b44b 100644 (file)
@@ -412,8 +412,7 @@ CRM_Utils_System::authenticateScript(TRUE);
 //log the execution of script
 CRM_Core_Error::debug_log_message('ContributionProcessor.php');
 
-require_once 'CRM/Core/Lock.php';
-$lock = new CRM_Core_Lock('CiviContributeProcessor');
+$lock = Civi\Core\Container::singleton()->get('lockManager')->acquire('worker.contribute.CiviContributeProcessor');
 
 if ($lock->isAcquired()) {
   // try to unset any time limits
@@ -424,7 +423,7 @@ if ($lock->isAcquired()) {
   CiviContributeProcessor::process();
 }
 else {
-  throw new Exception('Could not acquire lock, another CiviMailProcessor process is running');
+  throw new Exception('Could not acquire lock, another CiviContributeProcessor process is running');
 }
 
 $lock->release();