1
0
v2board 2 жил өмнө
parent
commit
2f153acd51

+ 2 - 0
app/Jobs/OrderHandleJob.php

@@ -15,6 +15,8 @@ class OrderHandleJob implements ShouldQueue
     use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
     protected $order;
 
+    public $tries = 3;
+    public $timeout = 5;
     /**
      * Create a new job instance.
      *

+ 2 - 0
app/Jobs/SendEmailJob.php

@@ -16,6 +16,8 @@ class SendEmailJob implements ShouldQueue
     use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
     protected $params;
 
+    public $tries = 3;
+    public $timeout = 10;
     /**
      * Create a new job instance.
      *

+ 1 - 1
app/Jobs/SendTelegramJob.php

@@ -16,7 +16,7 @@ class SendTelegramJob implements ShouldQueue
     protected $text;
 
     public $tries = 3;
-    public $timeout = 5;
+    public $timeout = 10;
 
     /**
      * Create a new job instance.

+ 13 - 11
app/Jobs/StatServerJob.php

@@ -19,7 +19,7 @@ class StatServerJob implements ShouldQueue
     protected $recordType;
 
     public $tries = 3;
-    public $timeout = 60;
+    public $timeout = 10;
 
     /**
      * Create a new job instance.
@@ -53,16 +53,8 @@ class StatServerJob implements ShouldQueue
             ->where('server_id', $this->server['id'])
             ->where('server_type', $this->protocol)
             ->first();
-        if ($data) {
-            try {
-                $data->update([
-                    'u' => $data['u'] + $this->u,
-                    'd' => $data['d'] + $this->d
-                ]);
-            } catch (\Exception $e) {
-                abort(500, '节点统计数据更新失败');
-            }
-        } else {
+
+        if (!$data) {
             if (!StatServer::create([
                 'server_id' => $this->server['id'],
                 'server_type' => $this->protocol,
@@ -73,6 +65,16 @@ class StatServerJob implements ShouldQueue
             ])) {
                 abort(500, '节点统计数据创建失败');
             }
+            return;
+        }
+
+        try {
+            $data->update([
+                'u' => $data['u'] + $this->u,
+                'd' => $data['d'] + $this->d
+            ]);
+        } catch (\Exception $e) {
+            abort(500, '节点统计数据更新失败');
         }
     }
 }

+ 1 - 1
app/Jobs/StatUserJob.php

@@ -21,7 +21,7 @@ class StatUserJob implements ShouldQueue
     protected $recordType;
 
     public $tries = 3;
-    public $timeout = 60;
+    public $timeout = 10;
 
     /**
      * Create a new job instance.

+ 1 - 1
app/Jobs/TrafficFetchJob.php

@@ -20,7 +20,7 @@ class TrafficFetchJob implements ShouldQueue
     protected $protocol;
 
     public $tries = 3;
-    public $timeout = 3;
+    public $timeout = 10;
 
     /**
      * Create a new job instance.