Merge pull request #5170 from annando/poller-worker

We don't poll, we work ... Bugfix for renamed config value.
pull/5171/head
Hypolite Petovan 2018-06-04 18:41:22 -04:00 committed by GitHub
commit 533c3a88c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -801,7 +801,7 @@ function admin_page_summary(App $a)
$warningtext[] = L10n::t('The database update failed. Please run "php bin/console.php dbstructure update" from the command line and have a look at the errors that might appear.');
}
$last_worker_call = Config::get('system', 'last_poller_execution', false);
$last_worker_call = Config::get('system', 'last_worker_execution', false);
if (!$last_worker_call) {
$showwarning = true;
$warningtext[] = L10n::t('The worker was never executed. Please check your database structure!');

View File

@ -40,7 +40,9 @@ function worker_init(){
// But since it doesn't destroy anything, we just try to get more execution time in any way.
set_time_limit(0);
if (poller_claim_process($r[0])) {
$fields = ['executed' => DateTimeFormat::utcNow(), 'pid' => getmypid(), 'done' => false];
$condition = ['id' => $r[0]["id"], 'pid' => 0];
if (dba::update('workerqueue', $fields, $condition)) {
Worker::execute($r[0]);
}
}