//if it doesn't die, it's authenticated
//log the execution of script
CRM_Core_Error::debug_log_message('EmailProcessor.php from the cli');
- require_once 'CRM/Core/Lock.php';
- $lock = new CRM_Core_Lock('EmailProcessor');
+ $lock = Civi\Core\Container::singleton()->get('lockManager')->acquire('worker.mailing.EmailProcessor');
if (!$lock->isAcquired()) {
throw new Exception('Could not acquire lock, another EmailProcessor process is running');
//log the execution of script
CRM_Core_Error::debug_log_message('EmailProcessor.php');
- require_once 'CRM/Core/Lock.php';
- $lock = new CRM_Core_Lock('EmailProcessor');
+ $lock = Civi\Core\Container::singleton()->get('lockManager')->acquire('worker.mailing.EmailProcessor');
if (!$lock->isAcquired()) {
throw new Exception('Could not acquire lock, another EmailProcessor process is running');