mirror of
				https://github.com/v2board/v2board.git
				synced 2025-11-01 01:41:47 +08:00 
			
		
		
		
	update: job timeout
This commit is contained in:
		| @@ -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. | ||||
|      * | ||||
|   | ||||
| @@ -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. | ||||
|      * | ||||
|   | ||||
| @@ -16,7 +16,7 @@ class SendTelegramJob implements ShouldQueue | ||||
|     protected $text; | ||||
|  | ||||
|     public $tries = 3; | ||||
|     public $timeout = 5; | ||||
|     public $timeout = 10; | ||||
|  | ||||
|     /** | ||||
|      * Create a new job instance. | ||||
|   | ||||
| @@ -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, '节点统计数据更新失败'); | ||||
|         } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -21,7 +21,7 @@ class StatUserJob implements ShouldQueue | ||||
|     protected $recordType; | ||||
|  | ||||
|     public $tries = 3; | ||||
|     public $timeout = 60; | ||||
|     public $timeout = 10; | ||||
|  | ||||
|     /** | ||||
|      * Create a new job instance. | ||||
|   | ||||
| @@ -20,7 +20,7 @@ class TrafficFetchJob implements ShouldQueue | ||||
|     protected $protocol; | ||||
|  | ||||
|     public $tries = 3; | ||||
|     public $timeout = 3; | ||||
|     public $timeout = 10; | ||||
|  | ||||
|     /** | ||||
|      * Create a new job instance. | ||||
|   | ||||
		Reference in New Issue
	
	Block a user