GuaranteeCountListen.php 563 B

123456789101112131415161718192021222324
  1. <?php
  2. namespace ln\listens;
  3. use ln\interfaces\ListenerInterface;
  4. use ln\jobs\GauaranteeCountJob;
  5. use ln\services\TimerService;
  6. use think\facade\Log;
  7. class GuaranteeCountListen extends TimerService implements ListenerInterface
  8. {
  9. public function handle($event): void
  10. {
  11. $this->tick(1000 * 60 * 15, function () {
  12. try {
  13. queue(GauaranteeCountJob::class,[]);
  14. } catch (\Exception $e) {
  15. Log::info('自动更新保障服务数量失败' . var_export($e, true));
  16. }
  17. });
  18. }
  19. }