]> git.mxchange.org Git - friendica.git/commitdiff
Locking seems to be better here
authorMichael <heluecht@pirati.ca>
Mon, 12 Jun 2017 12:28:48 +0000 (12:28 +0000)
committerMichael <heluecht@pirati.ca>
Mon, 12 Jun 2017 12:28:48 +0000 (12:28 +0000)
boot.php
include/pubsubpublish.php

index b93810d774309a10c83cf3d639197b4645363565..d30d978cad70f4a32a31704509f56aba6dddee08 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -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;
index 580e3ffce18038f8b86f521f28acdf2d54a80aaf..0cefa5531dead1095fd73c342e1a8a417d380dd4 100644 (file)
@@ -20,6 +20,7 @@ function pubsubpublish_run(&$argv, &$argc){
                        logger("Publish feed to ".$rr["callback_url"], LOGGER_DEBUG);
                        proc_run(array('priority' => PRIORITY_HIGH, 'created' => $a->queue['created'], 'dont_fork' => true),
                                        'include/pubsubpublish.php', (int)$rr["id"]);
+                       logger("Publish feed to ".$rr["callback_url"].' - done', LOGGER_DEBUG);
                }
        }