26 lines
424 B
PHP
26 lines
424 B
PHP
<?php
|
|
namespace App\Bean\Queue;
|
|
|
|
use App\Bean\Model\Base\BaseBean;
|
|
|
|
class QueueBaseBean extends BaseBean
|
|
{
|
|
const TRY_LIMIT = 3;
|
|
protected $try_times = 0;
|
|
|
|
public function IncrTryTimes($num = 1): void
|
|
{
|
|
$this->try_times += $num;
|
|
}
|
|
|
|
public function checkTryTimes(): bool
|
|
{
|
|
if($this->try_times >= self::TRY_LIMIT) {
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
}
|
|
|