]> git.mxchange.org Git - friendica.git/commitdiff
Avoid sql error in process handling
authorMichael <heluecht@pirati.ca>
Wed, 17 Jan 2018 14:10:30 +0000 (14:10 +0000)
committerMichael <heluecht@pirati.ca>
Wed, 17 Jan 2018 14:10:30 +0000 (14:10 +0000)
src/Model/Process.php

index a960777129813f25a83254b1a758ae46bfb1bda9..8b7ce8d34ae80ee3b9536494a9e9e25502594e14 100644 (file)
@@ -26,9 +26,13 @@ class Process extends BaseObject
        {
                $return = true;
 
+               if (is_null($pid)) {
+                       $pid = getmypid();
+               }
+
                dba::transaction();
 
-               if (!dba::exists('process', ['pid' => getmypid()])) {
+               if (!dba::exists('process', ['pid' => $pid])) {
                        $return = dba::insert('process', ['pid' => $pid, 'command' => $command, 'created' => datetime_convert()]);
                }