1
1
Fork 0

Locking seems to be better here

This commit is contained in:
Michael 2017-06-12 12:28:48 +00:00
commit 2372ef7fd5
2 changed files with 5 additions and 0 deletions

View file

@ -1089,6 +1089,8 @@ function proc_run($cmd) {
$argv = $args;
array_shift($argv);
dba::lock('workerqueue');
$parameters = json_encode($argv);
$found = dba::select('workerqueue', array('id'), array('parameter' => $parameters), array('limit' => 1));
@ -1096,6 +1098,8 @@ function proc_run($cmd) {
dba::insert('workerqueue', array('parameter' => $parameters, 'created' => $created, 'priority' => $priority));
}
dba::unlock();
// Should we quit and wait for the poller to be called as a cronjob?
if ($dont_fork) {
return;