]> git.mxchange.org Git - friendica.git/commitdiff
dba is now used for writing the workerqueue as well
authorMichael <heluecht@pirati.ca>
Fri, 12 May 2017 16:25:44 +0000 (16:25 +0000)
committerMichael <heluecht@pirati.ca>
Fri, 12 May 2017 16:25:44 +0000 (16:25 +0000)
boot.php

index 5815b8db1d12b23a8eefb9c8fca455cfbb5d9935..e3fb320ac55f6860cc617ecce39911cf8a5b0baf 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -1077,14 +1077,10 @@ function proc_run($cmd) {
        array_shift($argv);
 
        $parameters = json_encode($argv);
-       $found = q("SELECT `id` FROM `workerqueue` WHERE `parameter` = '%s'", dbesc($parameters));
+       $found = dba::select('workerqueue', array('id'), array('parameter' => $parameters), array('limit' => 1));
 
        if (!dbm::is_result($found)) {
-               q("INSERT INTO `workerqueue` (`parameter`, `created`, `priority`)
-                       VALUES ('%s', '%s', %d)",
-                       dbesc($parameters),
-                       dbesc(datetime_convert()),
-                       intval($priority));
+               dba::insert('workerqueue', array('parameter' => $parameters, 'created' => datetime_convert(), 'priority' => $priority));
        }
 
        // Should we quit and wait for the poller to be called as a cronjob?