From fbb024d1517b847fbcd1655ff558b718cb15c17e Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 17 Jan 2018 14:10:30 +0000 Subject: [PATCH] Avoid sql error in process handling --- src/Model/Process.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Model/Process.php b/src/Model/Process.php index a960777129..8b7ce8d34a 100644 --- a/src/Model/Process.php +++ b/src/Model/Process.php @@ -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()]); } -- 2.39.5