write test for permission controller
This commit is contained in:
@@ -33,16 +33,14 @@ class SendRoadObservationToNikarayanCommand extends Command
|
||||
$this->info("Dispatching jobs with a delay between each...");
|
||||
|
||||
DB::transaction(function () use (&$count) {
|
||||
$delay = 0;
|
||||
RoadObserved::query()
|
||||
->whereBetween('StartTime_DateTime_fa', ['1403-01-01 00:00:00', '1403-07-13 23:59:59'])
|
||||
->chunkById(50, function ($roads) use (&$delay, &$count) {
|
||||
->chunkById(50, function ($roads) use (&$count) {
|
||||
foreach ($roads as $road) {
|
||||
$road->update(['status' => 1]);
|
||||
SendRoadObservationToNikarayan::dispatch($road)->delay(now()->addSeconds($delay));
|
||||
Log::channel('road_observation_problem')->info("Job for Road Observed ID {$road->id} scheduled with a {$delay} seconds delay.");
|
||||
$this->info("Scheduled job for Road ID: {$road->id} {$delay}s");
|
||||
$delay += 3;
|
||||
SendRoadObservationToNikarayan::dispatch($road);
|
||||
Log::channel('road_observation_problem')->info("Job for Road Observed ID {$road->id} scheduled.");
|
||||
$this->info("Scheduled job for Road ID: {$road->id}");
|
||||
$count +=1;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -45,12 +45,14 @@ class SendRoadObservationToNikarayan implements ShouldQueue
|
||||
);
|
||||
|
||||
$soapClient = new SoapClient($url);
|
||||
|
||||
$soapClient->UpdateInfo_RoadObservedProblems($array);
|
||||
$result = $soapClient->UpdateInfo_RoadObservedProblems($array);
|
||||
Log::channel('road_observation_problem')->info(json_encode($result), [$this->roadObserved->id]);
|
||||
}
|
||||
catch (\Exception $exception){
|
||||
Log::channel('road_observation_problem')->error($exception->getMessage(), [
|
||||
'roadObserved' => $this->roadObserved,
|
||||
'roadObserved' => $this->roadObserved->id,
|
||||
'line' => $exception->getLine(),
|
||||
'file' => $exception->getFile(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ class NikarayanService
|
||||
|
||||
$soapClient = new SoapClient($url);
|
||||
$result = $soapClient->UpdateInfo_RoadObservedProblems($array);
|
||||
Log::channel('nikarayan')->info($result);
|
||||
Log::channel('nikarayan')->info(json_encode($result));
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user