mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-04-20 16:37:48 +02:00
Handle stopping on inactivity properly
This commit is contained in:
parent
768714cc1a
commit
006eab7d07
1 changed files with 2 additions and 3 deletions
|
@ -47,9 +47,8 @@ class Phone extends AbstractDaemon
|
||||||
//Stop after 5 minutes of inactivity to avoid useless daemon
|
//Stop after 5 minutes of inactivity to avoid useless daemon
|
||||||
if ( (microtime(true) - $this->last_message_at) > 5 * 60 )
|
if ( (microtime(true) - $this->last_message_at) > 5 * 60 )
|
||||||
{
|
{
|
||||||
$this->is_running = false;
|
posix_kill(getmypid(), SIGTERM); //Send exit signal to the current process
|
||||||
$this->logger->info("End running");
|
return false;
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD, 'UTF8');
|
$this->bdd = \descartes\Model::_connect(DATABASE_HOST, DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD, 'UTF8');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue