Merge pull request #6444 from PalanteJon/CRM-16981
[civicrm-core.git] / bin / ContributionProcessor.php
index e6f23f43ad21aea998c0f5335e3828fdc66ee400..bf8096f964cafe5d9ab0bfe2480fe47d7bc8039d 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.6                                                |
+ | CiviCRM version 4.7                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2015                                |
  +--------------------------------------------------------------------+
@@ -699,8 +699,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
@@ -711,7 +710,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();