|
@@ -4,7 +4,9 @@
|
|
|
namespace App\Jobs;
|
|
namespace App\Jobs;
|
|
|
|
|
|
|
|
use App\Services\BetService;
|
|
use App\Services\BetService;
|
|
|
|
|
+use App\Services\LogService;
|
|
|
use App\Services\PcIssueService;
|
|
use App\Services\PcIssueService;
|
|
|
|
|
+use Exception;
|
|
|
use Illuminate\Bus\Queueable;
|
|
use Illuminate\Bus\Queueable;
|
|
|
use Illuminate\Contracts\Queue\ShouldBeUnique;
|
|
use Illuminate\Contracts\Queue\ShouldBeUnique;
|
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
@@ -47,7 +49,7 @@ class FiveSecondTaskJob implements ShouldQueue
|
|
|
public function handle()
|
|
public function handle()
|
|
|
{
|
|
{
|
|
|
try {
|
|
try {
|
|
|
- Log::error('🚀 开始执行15秒任务: ' . now());
|
|
|
|
|
|
|
+// Log::error('🚀 开始执行15秒任务: ' . now());
|
|
|
//自定义开奖
|
|
//自定义开奖
|
|
|
PcIssueService::index();
|
|
PcIssueService::index();
|
|
|
|
|
|
|
@@ -66,11 +68,14 @@ class FiveSecondTaskJob implements ShouldQueue
|
|
|
// 重要:使用类名而不是 self(),避免递归
|
|
// 重要:使用类名而不是 self(),避免递归
|
|
|
FiveSecondTaskJob::dispatch()->delay(now()->addSeconds(15));
|
|
FiveSecondTaskJob::dispatch()->delay(now()->addSeconds(15));
|
|
|
|
|
|
|
|
- Log::error('📅 下一个15秒任务已安排');
|
|
|
|
|
-
|
|
|
|
|
- } catch (\Exception $e) {
|
|
|
|
|
- Log::error('❌ 15秒任务执行异常: ' . $e->getMessage());
|
|
|
|
|
|
|
+// Log::error('📅 下一个15秒任务已安排');
|
|
|
|
|
|
|
|
|
|
+ } catch (Exception $e) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ throw new Exception('❌ 15秒任务执行异常: ' . $e->getMessage());
|
|
|
|
|
+ }catch (Exception $e) {
|
|
|
|
|
+ LogService::error($e);
|
|
|
|
|
+ }
|
|
|
// 异常后15秒重试
|
|
// 异常后15秒重试
|
|
|
FiveSecondTaskJob::dispatch()->delay(now()->addSeconds(15));
|
|
FiveSecondTaskJob::dispatch()->delay(now()->addSeconds(15));
|
|
|
}
|
|
}
|