platform notify
This commit is contained in:
@ -5,7 +5,7 @@ use App\Bean\Model\Base\BaseBean;
|
||||
|
||||
class QueueBaseBean extends BaseBean
|
||||
{
|
||||
const TRY_LIMIT = 3;
|
||||
protected $try_limt = 3;
|
||||
protected $try_times = 0;
|
||||
|
||||
public function IncrTryTimes($num = 1): void
|
||||
@ -15,11 +15,21 @@ class QueueBaseBean extends BaseBean
|
||||
|
||||
public function checkTryTimes(): bool
|
||||
{
|
||||
if($this->try_times >= self::TRY_LIMIT) {
|
||||
if($this->try_times >= $this->try_limt) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getTryTimes(): int
|
||||
{
|
||||
return $this->try_times;
|
||||
}
|
||||
|
||||
function getDelaySeconds($seconds = 30): int
|
||||
{
|
||||
return $seconds * $this->try_times;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user