Avoid sql error in process handling
This commit is contained in:
parent
a526573075
commit
fbb024d151
1 changed files with 5 additions and 1 deletions
|
@ -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()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue