mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-04-20 16:37:48 +02:00
improve callback update status
This commit is contained in:
parent
eef74f1e9c
commit
3d19c4decb
2 changed files with 11 additions and 3 deletions
|
@ -120,14 +120,22 @@ use Monolog\Logger;
|
|||
return false;
|
||||
}
|
||||
|
||||
//Do not update if current status is delivered or failed
|
||||
if (\models\Sended::STATUS_DELIVERED === $sended['status'] || \models\Sended::STATUS_FAILED === $sended['status'])
|
||||
//Do not update if current status is delivered
|
||||
if (\models\Sended::STATUS_DELIVERED === $sended['status'])
|
||||
{
|
||||
$this->logger->info('Callback status update message ignore because status is already ' . $sended['status'] . '.');
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//Do not update if current status is failed and new status is unknown
|
||||
if (\models\Sended::STATUS_FAILED === $sended['status'] && \models\Sended::STATUS_UNKNOWN == $callback_return['status'])
|
||||
{
|
||||
$this->logger->info('Callback status update message ignore because status is already ' . $sended['status'] . ' and new status is ' . $callback_return['status'] . '.');
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->logger->info('Callback status update message with uid ' . $callback_return['uid'] . ' to ' . $callback_return['status'] . '.');
|
||||
$this->internal_sended->update_status_for_user($this->user['id'], $sended['id'], $callback_return['status']);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue