| 1234567891011121314151617181920212223242526 |
- <?php
- namespace App\Module\Sys;
- class Job
- {
- /**
- * 是否可以批量创建队列
- * 超出一定的堆积数额就不允许了
- *
- * @return void
- */
- static public function canPiliang()
- {
- $count = \App\Module\System\Services\Model\Job::query()
- ->where('available_at', '<', time() + 3)
- ->count();
- if ($count > 50) {
- return false;
- }
- return true;
- }
- }
|