Update Carbon usage in lib

[MAILPOET-3232]
This commit is contained in:
Rostislav Wolny
2020-10-20 16:48:33 +02:00
committed by Veljko V
parent a376057560
commit e5a671900b
5 changed files with 12 additions and 6 deletions

View File

@@ -325,9 +325,9 @@ class SendingQueue {
$bounceTasks = ScheduledTask::findFutureScheduledByType(Bounce::TASK_TYPE);
if (count($bounceTasks)) {
$bounceTask = reset($bounceTasks);
if (Carbon::createFromTimestamp((int)current_time('timestamp'))->addHour(42)->lessThan($bounceTask->scheduledAt)) {
if (Carbon::createFromTimestamp((int)current_time('timestamp'))->addHours(42)->lessThan($bounceTask->scheduledAt)) {
$randomOffset = rand(-6 * 60 * 60, 6 * 60 * 60);
$bounceTask->scheduledAt = Carbon::createFromTimestamp((int)current_time('timestamp'))->addSecond((36 * 60 * 60) + $randomOffset);
$bounceTask->scheduledAt = Carbon::createFromTimestamp((int)current_time('timestamp'))->addSeconds((36 * 60 * 60) + $randomOffset);
$bounceTask->save();
}
}