Fix invalid closing of queues from sender, improve cleaning of pid files

This commit is contained in:
osaajani 2020-03-04 03:28:34 +01:00
parent 6f8c7d62b9
commit ca9397b62d
5 changed files with 14 additions and 17 deletions

View file

@ -54,7 +54,7 @@ class Sender extends AbstractDaemon
}
/**
* Function to get messages to send and transfer theme to phones daemons.
* Function to transfer smss to send to phones daemons.
*
* @param array $smss : Smss to send
*/
@ -80,6 +80,7 @@ class Sender extends AbstractDaemon
msg_send($this->queues[$queue_id], QUEUE_TYPE_SEND_MSG, $msg);
$this->logger->info('Transmit sms send signal to phone ' . $sms['id_phone'] . ' on queue ' . $queue_id . '.');
$this->internal_scheduled->delete($sms['id_scheduled']);
}
}
@ -93,13 +94,6 @@ class Sender extends AbstractDaemon
public function on_stop()
{
$this->logger->info('Stopping Sender with pid ' . getmypid());
//Delete queues on daemon close
foreach ($this->queues as $queue_id => $queue)
{
$this->logger->info('Closing queue : ' . $queue_id);
msg_remove_queue($queue);
}
}
public function handle_other_signals($signal)