mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-31 08:10:21 +00:00
perf: 任务提醒时间区间放大,防止定时器出现意外发送不到问题
This commit is contained in:
parent
47c0c3fa3f
commit
b332c4e23d
@ -26,8 +26,8 @@ class OverdueRemindEmailTask extends AbstractTask
|
||||
if ($hours > 0) {
|
||||
$time1 = Carbon::now()->addMinutes($hours * 60);
|
||||
$taskLists1 = ProjectTask::whereNull('complete_at')
|
||||
->where('end_at', '>=', $time1->subMinutes(2))
|
||||
->where('end_at', '<=', $time1->addMinutes(2))
|
||||
->where('end_at', '>=', $time1->subMinutes(30))
|
||||
->where('end_at', '<=', $time1->addMinutes(30))
|
||||
->whereNull('archived_at')
|
||||
->take(100)
|
||||
->get()
|
||||
@ -36,8 +36,8 @@ class OverdueRemindEmailTask extends AbstractTask
|
||||
if ($hours2 > 0) {
|
||||
$time2 = Carbon::now()->subMinutes($hours2 * 60);
|
||||
$taskLists2 = ProjectTask::whereNull('complete_at')
|
||||
->where('end_at', '>=', $time2->subMinutes(2))
|
||||
->where('end_at', '<=', $time2->addMinutes(2))
|
||||
->where('end_at', '>=', $time2->subMinutes(30))
|
||||
->where('end_at', '<=', $time2->addMinutes(30))
|
||||
->whereNull('archived_at')
|
||||
->take(100)
|
||||
->get()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user