Fix simple sms api + add wait on system v queue (see to improve that later)

This commit is contained in:
osaajani 2024-11-21 18:04:05 +01:00
parent 473fb297f3
commit 04b0f1267a
2 changed files with 13 additions and 2 deletions

View File

@ -327,7 +327,18 @@ namespace controllers\publics;
} }
$at = (new \DateTime())->format('Y-m-d H:i:s'); $at = (new \DateTime())->format('Y-m-d H:i:s');
$scheduled_id = $this->internal_scheduled->create($this->user['id'], $at, $text, $id_phone);
$scheduled_id = $this->internal_scheduled->create(
$this->user['id'],
$at,
$text,
$id_phone,
null,
false,
false,
null,
[['number' => $to, 'data' => '[]']]
);
if (!$scheduled_id) if (!$scheduled_id)
{ {
$return = self::DEFAULT_RETURN; $return = self::DEFAULT_RETURN;

View File

@ -70,7 +70,7 @@ class SystemVQueue implements Queue
$this->get_queue(); $this->get_queue();
$error_code = null; $error_code = null;
$success = msg_send($this->queue, $tag, $message, true, false, $error_code); $success = msg_send($this->queue, $tag, $message, true, true, $error_code);
if (!$success) if (!$success)
{ {
throw new \Exception('Impossible to send the message on system V queue, error code : ' . $error_code); throw new \Exception('Impossible to send the message on system V queue, error code : ' . $error_code);