#!/bin/sh
cd /www/wwwroot/faithfulness
sudo -u www /usr/bin/php artisan tinker --execute="
\$rows = DB::table('location_route_caches')->whereNotNull('driving_distance_m')->count();
echo 'rows with driving data: '.\$rows.'/36'.PHP_EOL;
\$sample = DB::table('location_route_caches')->whereNotNull('driving_distance_m')->first();
if (\$sample) { echo 'sample: driving '.\$sample->driving_distance_m.'m/'.\$sample->driving_duration_s.'s, walking '.\$sample->walking_distance_m.'m'.PHP_EOL; }
echo 'lastUpdated cache: '.(Illuminate\Support\Facades\Cache::get('location_route_caches_updated_at') ?? 'EMPTY').PHP_EOL;
" 2>&1 | grep -E "rows|sample|lastUpdated"
