Merge pull request #4446 from annando/worker-priority

Bugfix: The provided worker priority had been ignored
This commit is contained in:
Hypolite Petovan 2018-02-12 22:29:53 -05:00 committed by GitHub
commit 219182d41e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1018,6 +1018,8 @@ class Worker
$dont_fork = Config::get("system", "worker_dont_fork"); $dont_fork = Config::get("system", "worker_dont_fork");
$created = DateTimeFormat::utcNow(); $created = DateTimeFormat::utcNow();
$run_parameter = array_shift($args);
if (is_int($run_parameter)) { if (is_int($run_parameter)) {
$priority = $run_parameter; $priority = $run_parameter;
} elseif (is_array($run_parameter)) { } elseif (is_array($run_parameter)) {
@ -1032,8 +1034,6 @@ class Worker
} }
} }
array_shift($args);
$parameters = json_encode($args); $parameters = json_encode($args);
$found = dba::exists('workerqueue', ['parameter' => $parameters, 'done' => false]); $found = dba::exists('workerqueue', ['parameter' => $parameters, 'done' => false]);