Compare commits

...

2 Commits

Author SHA1 Message Date
Ben Goldsworthy 6e0eb2abcc change cache check 2023-05-18 13:38:53 -06:00
Ben Goldsworthy 42fb68759e fix: avoid gaps in route 2023-05-18 12:10:13 -06:00
2 changed files with 3 additions and 2 deletions

View File

@ -145,6 +145,7 @@ class TrackerController extends Controller
// Otherwise, download the trip data from the Wayward API.
if ($forceDownload) {
Log::debug("Forcing download for '{$tripFileName}'.");
Storage::disk('local')->delete($tripFileName);
} else {
Log::debug("No cached trip file found for '{$tripFileName}'.");
}
@ -168,7 +169,7 @@ class TrackerController extends Controller
Storage::disk('local')->put($tripFileName, json_encode($data));
} else {
$cachedData = json_decode(Storage::disk('local')->get($tripFileName));
if ($data->trip->updated_at !== $cachedData->trip->updated_at) {
if (end($data->checkins)->date !== end($cachedData->checkins)->date) {
Log::debug(
"Cached trip file '" .
$tripFileName .

View File

@ -59,7 +59,7 @@
attribution: 'OpenStreetMap'
}).addTo(map);
@for($idx = 0; $idx <= count($trip->locations); $idx += 100)
@for($idx = 0; $idx <= count($trip->locations); $idx += 99)
/*
* Populate the route line.
*/