X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=api%2Fv3%2FJob.php;h=c68c9b9140da4a24d260ec78b92ec86e51793320;hb=b05a9fbaeb8c99e535d189e8b181ea0dcc75e8ec;hp=8bb86189fb8827cbc2f0a39d56c174cff6571bae;hpb=35dabaefc39d4e0938a8fd78698f612059b2d839;p=civicrm-core.git diff --git a/api/v3/Job.php b/api/v3/Job.php index 8bb86189fb..c68c9b9140 100644 --- a/api/v3/Job.php +++ b/api/v3/Job.php @@ -1,7 +1,7 @@ get('lockManager')->acquire('worker.core.ActionSchedule'); + $lock = Civi::lockManager()->acquire('worker.core.ActionSchedule'); if (!$lock->isAcquired()) { return civicrm_api3_create_error('Could not acquire lock, another ActionSchedule process is running'); } @@ -354,7 +354,7 @@ function civicrm_api3_job_process_sms($params) { * @return array */ function civicrm_api3_job_fetch_bounces($params) { - $lock = Civi\Core\Container::singleton()->get('lockManager')->acquire('worker.mailing.EmailProcessor'); + $lock = Civi::lockManager()->acquire('worker.mailing.EmailProcessor'); if (!$lock->isAcquired()) { return civicrm_api3_create_error('Could not acquire lock, another EmailProcessor process is running'); } @@ -377,7 +377,7 @@ function civicrm_api3_job_fetch_bounces($params) { * @return array */ function civicrm_api3_job_fetch_activities($params) { - $lock = Civi\Core\Container::singleton()->get('lockManager')->acquire('worker.mailing.EmailProcessor'); + $lock = Civi::lockManager()->acquire('worker.mailing.EmailProcessor'); if (!$lock->isAcquired()) { return civicrm_api3_create_error('Could not acquire lock, another EmailProcessor process is running'); } @@ -430,7 +430,7 @@ function civicrm_api3_job_process_participant($params) { * true if success, else false */ function civicrm_api3_job_process_membership($params) { - $lock = Civi\Core\Container::singleton()->get('lockManager')->acquire('worker.member.UpdateMembership'); + $lock = Civi::lockManager()->acquire('worker.member.UpdateMembership'); if (!$lock->isAcquired()) { return civicrm_api3_create_error('Could not acquire lock, another Membership Processing process is running'); } @@ -627,7 +627,7 @@ function civicrm_api3_job_disable_expired_relationships($params) { * @throws \API_Exception */ function civicrm_api3_job_group_rebuild($params) { - $lock = Civi\Core\Container::singleton()->get('lockManager')->acquire('worker.core.GroupRebuild'); + $lock = Civi::lockManager()->acquire('worker.core.GroupRebuild'); if (!$lock->isAcquired()) { throw new API_Exception('Could not acquire lock, another EmailProcessor process is running'); } @@ -639,3 +639,14 @@ function civicrm_api3_job_group_rebuild($params) { return civicrm_api3_create_success(); } + +/** + * Check for CiviCRM software updates. + * + * Anonymous site statistics are sent back to civicrm.org during this check. + */ +function civicrm_api3_job_version_check() { + $vc = new CRM_Utils_VersionCheck(); + $vc->fetch(); + return civicrm_api3_create_success(); +}