Skip to content

Commit f71cab3

Browse files
committed
Add multiple timeOut types
1 parent 83ef34c commit f71cab3

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/Abstracts/AbstractBlockBots.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,25 @@ public function setUp($request, $limit, $frequency)
3131
$this->setClient();
3232
}
3333

34+
protected function beforeHandle()
35+
{
36+
}
3437

3538
protected function setTimeOut()
3639
{
3740
switch ($this->frequency) {
41+
case 'hourly':
42+
$this->timeOutAt = Carbon::now()->addHour(1)->timestamp;
43+
break;
3844
case 'daily':
3945
$this->timeOutAt = Carbon::tomorrow()->startOfDay()->timestamp;
4046
break;
47+
case 'monthly':
48+
$this->timeOutAt = (new Carbon('first day of next month'))->firstOfMonth()->startOfDay()->timestamp;
49+
break;
50+
case 'annually':
51+
$this->timeOutAt = (new Carbon('next year'))->startOfYear()->firstOfMonth()->startOfDay()->timestamp;
52+
break;
4153
}
4254
}
4355

0 commit comments

Comments
 (0)