Skip to content

Commit

Permalink
🐛 Fix queue of journey refresh script (#1027)
Browse files Browse the repository at this point in the history
  • Loading branch information
MrKrisKrisu authored Aug 31, 2022
1 parent 3a18de2 commit 1daa9d0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions app/Console/Commands/RefreshCurrentTrips.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public function handle(): int {
$loop = 1;
foreach ($trips as $trip) {
$this->info('Refreshing trip ' . $trip->trip_id . ' (' . $trip->linename . ')...');
$trip->update(['last_refreshed' => now()]);

$rawHafas = HafasController::fetchRawHafasTrip($trip->trip_id, $trip->linename);

Expand Down Expand Up @@ -85,8 +86,6 @@ public function handle(): int {

$this->info('Updated ' . $res . ' rows.');

$trip->update(['last_refreshed' => now()]);

if ($loop++ >= config('trwl.refresh.max_trips_per_minute')) {
$this->warn('Max number of trips reached. Waiting for next minute...');
return 0;
Expand Down

0 comments on commit 1daa9d0

Please sign in to comment.