From 111c9d1565f75735516f6f310e8997a5b58e351f Mon Sep 17 00:00:00 2001 From: amirghasempoor Date: Mon, 25 Aug 2025 14:23:48 +0330 Subject: [PATCH] add config file --- .env.example | 6 +++++- app/Services/FMS/GetErrorRateService.php | 8 ++++---- config/fms_web_services.php | 5 +++++ config/horizon.php | 24 +++++++++++++++++++++++- config/logging.php | 6 ++++++ 5 files changed, 43 insertions(+), 6 deletions(-) diff --git a/.env.example b/.env.example index 87bbe2f7..ebfd2389 100644 --- a/.env.example +++ b/.env.example @@ -65,4 +65,8 @@ CMMS_MACHINE_INFO_VIEW_NAME= FMS_VEHICLE_ACTIVITY_URL= FMS_VEHICLE_ACTIVITY_PASSWORD= -FMS_VEHICLE_ACTIVITY_USERNAME= \ No newline at end of file +FMS_VEHICLE_ACTIVITY_USERNAME= + +FMS_ERROR_RATE_URL= +FMS_ERROR_RATE_PASSWORD= +FMS_ERROR_RATE_USERNAME= \ No newline at end of file diff --git a/app/Services/FMS/GetErrorRateService.php b/app/Services/FMS/GetErrorRateService.php index bcf02c4e..aa86d83c 100644 --- a/app/Services/FMS/GetErrorRateService.php +++ b/app/Services/FMS/GetErrorRateService.php @@ -16,10 +16,10 @@ class GetErrorRateService public function __construct() { - $this->url = config('fms_web_services.Vehicle_Activity.url'); - $this->password = config('fms_web_services.Vehicle_Activity.password'); - $this->username = config('fms_web_services.Vehicle_Activity.username'); - $this->channelName = 'fms_vehicle_activity'; + $this->url = config('fms_web_services.Error_Rate.url'); + $this->password = config('fms_web_services.Error_Rate.password'); + $this->username = config('fms_web_services.Error_Rate.username'); + $this->channelName = 'fms_error_rate'; } public function setInputParameters(array $inputs): void diff --git a/config/fms_web_services.php b/config/fms_web_services.php index fe06bba3..a9715926 100644 --- a/config/fms_web_services.php +++ b/config/fms_web_services.php @@ -6,4 +6,9 @@ return [ 'password' => env('FMS_VEHICLE_ACTIVITY_PASSWORD'), 'username' => env('FMS_VEHICLE_ACTIVITY_USERNAME'), ], + 'Error_Rate' => [ + 'url' => env('FMS_ERROR_RATE_URL'), + 'password' => env('FMS_ERROR_RATE_PASSWORD'), + 'username' => env('FMS_ERROR_RATE_USERNAME'), + ], ]; \ No newline at end of file diff --git a/config/horizon.php b/config/horizon.php index 8b1f9e44..30c4c398 100644 --- a/config/horizon.php +++ b/config/horizon.php @@ -182,7 +182,21 @@ return [ 'defaults' => [ 'supervisor-1' => [ 'connection' => 'redis', - 'queue' => ['default'], + 'queue' => ['harim'], + 'balance' => 'auto', + 'autoScalingStrategy' => 'time', + 'maxProcesses' => 1, + 'maxTime' => 0, + 'maxJobs' => 0, + 'memory' => 128, + 'tries' => 2, + 'timeout' => 60, + 'nice' => 0, + 'backoff' => 10, + ], + 'supervisor-2' => [ + 'connection' => 'redis', + 'queue' => ['fms'], 'balance' => 'auto', 'autoScalingStrategy' => 'time', 'maxProcesses' => 1, @@ -203,12 +217,20 @@ return [ 'balanceMaxShift' => 1, 'balanceCooldown' => 3, ], + 'supervisor-2' => [ + 'maxProcesses' => 10, + 'balanceMaxShift' => 1, + 'balanceCooldown' => 3, + ], ], 'local' => [ 'supervisor-1' => [ 'maxProcesses' => 3, ], + 'supervisor-2' => [ + 'maxProcesses' => 3, + ], ], ], ]; diff --git a/config/logging.php b/config/logging.php index c0b8208e..dced418b 100644 --- a/config/logging.php +++ b/config/logging.php @@ -129,6 +129,12 @@ return [ 'path' => storage_path('logs/nikarayan.log'), 'level' => 'info', ], + + 'fms_error_rate' => [ + 'driver' => 'single', + 'path' => storage_path('logs/fms/error_rate_service.log'), + 'level' => 'info', + ], ], ];