Merge pull request #4261 from annando/bugfix-process

Avoid sql error in process handling
This commit is contained in:
Hypolite Petovan 2018-01-17 10:45:16 -05:00 committed by GitHub
commit ca0a261e08
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -26,9 +26,13 @@ class Process extends BaseObject
{ {
$return = true; $return = true;
if (is_null($pid)) {
$pid = getmypid();
}
dba::transaction(); 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()]); $return = dba::insert('process', ['pid' => $pid, 'command' => $command, 'created' => datetime_convert()]);
} }