Fix setting next_at date for dynamics items, when the item hasnt been sent in the last run
All checks were successful
Create Docker Image / Build Docker Image (x86_64) (push) Successful in 34s
Create Docker Image / Build Docker Image (arm64) (push) Successful in 1m41s
Create Docker Image / Final Docker Image Manifest (push) Successful in 8s

This commit is contained in:
Deon George 2025-03-24 11:20:11 +11:00
parent 2458ca2408
commit 9bc880520f

View File

@ -3,6 +3,7 @@
namespace App\Classes\File\Send;
use Carbon\Carbon;
use Illuminate\Support\Facades\Log;
use App\Classes\File\Send;
use App\Classes\Node;
@ -56,6 +57,8 @@ final class Dynamic extends Send
public function close(bool $successful,Node $node): void
{
Log::debug(sprintf('%s:- Close [%s] - %s',self::LOGKEY,$this->nameas,$successful ? 'SUCCESSFUL' : 'FAILED'));
if ($successful) {
$this->complete = TRUE;
@ -75,7 +78,7 @@ final class Dynamic extends Send
->addDay();
while ($this->do->next_at->isPast())
$this->do->next_at->addDay();
$this->do->next_at = $this->do->next_at->addDay();
break;
@ -84,7 +87,7 @@ final class Dynamic extends Send
->addWeek();
while ($this->do->next_at->isPast())
$this->do->next_at->addWeek();
$this->do->next_at = $this->do->next_at->addWeek();
break;
@ -93,7 +96,7 @@ final class Dynamic extends Send
->addMonth();
while ($this->do->next_at->isPast())
$this->do->next_at->addMonth();
$this->do->next_at = $this->do->next_at->addMonth();
break;
@ -101,6 +104,8 @@ final class Dynamic extends Send
throw new \Exception(sprintf('%s:! Unknown frequency [%s] for [%d]',self::LOGKEY,$this->do->frequency,$this->do->id));
}
Log::debug(sprintf('%s: - Frequency [%s], UPDATE next_at [%s]',self::LOGKEY,$this->do->frequency,$next_at->format('Y-m-d H:i:s')));
$this->do->save();
}
}