feat: enhance periodic sync logging and improve airport mode handling in LocationSearchMap

This commit is contained in:
Sean Morley
2026-01-09 14:32:14 -05:00
parent f37d546525
commit 49cf7f8f60
4 changed files with 44 additions and 28 deletions

View File

@@ -63,7 +63,7 @@ def run_sync():
def main():
"""Main loop - run sync every INTERVAL_SECONDS."""
logger.info(f"Starting periodic sync (interval: {INTERVAL_SECONDS}s)")
logger.info(f"Starting periodic sync worker for midnight background jobs...")
# Install signal handlers so supervisord (or other process managers)
# can request a clean shutdown using SIGTERM/SIGINT.
@@ -76,7 +76,7 @@ def main():
wait_seconds = _seconds_until_next_midnight()
hours = wait_seconds / 3600.0
logger.info(
f"Next sync scheduled in {wait_seconds:.0f}s (~{hours:.2f}h) at local midnight"
f"Next sync scheduled in {wait_seconds:.0f}s (~{hours:.2f}h) at UTC midnight"
)
# Sleep until midnight or until stop event is set
if _stop_event.wait(wait_seconds):

View File

@@ -78,31 +78,39 @@
// track previous airport mode to detect toggles
let prevAirportMode = airportMode;
let airportModeInitialized = false;
// Clear inputs/selections when airportMode is toggled
// Clear inputs/selections when airportMode is toggled (but not during initial setup)
$: if (prevAirportMode !== airportMode) {
prevAirportMode = airportMode;
// clear single-location search state
searchQuery = '';
searchResults = [];
selectedLocation = null;
selectedMarker = null;
locationData = null;
// clear transportation-mode search state
startSearchQuery = '';
endSearchQuery = '';
startSearchResults = [];
endSearchResults = [];
selectedStartLocation = null;
selectedEndLocation = null;
startMarker = null;
endMarker = null;
mapBounds = null;
startLocationData = null;
startCode = null;
endCode = null;
endLocationData = null;
// Only clear if this is not the first time airportMode is being set
// This prevents wiping out initial location data when editing existing plane transportations
if (airportModeInitialized) {
// clear single-location search state
searchQuery = '';
searchResults = [];
selectedLocation = null;
selectedMarker = null;
locationData = null;
// clear transportation-mode search state
startSearchQuery = '';
endSearchQuery = '';
startSearchResults = [];
endSearchResults = [];
selectedStartLocation = null;
selectedEndLocation = null;
startMarker = null;
endMarker = null;
mapBounds = null;
startLocationData = null;
startCode = null;
endCode = null;
endLocationData = null;
}
airportModeInitialized = true;
}
// Transportation mode variables

View File

@@ -922,7 +922,11 @@
"enter_from_location": "Enter from location",
"enter_to_location": "Enter to location",
"arrival_code": "Arrival Code",
"departure_code": "Departure Code"
"departure_code": "Departure Code",
"arrival_date": "Arrival Date",
"departure_timezone": "Departure Timezone",
"arrival_timezone": "Arrival Timezone",
"departure_date": "Departure Date"
},
"lodging": {
"new_lodging": "New Lodging",

View File

@@ -181,10 +181,14 @@
const regionClusterOptions: ClusterOptions = { radius: 300, maxZoom: 8, minPoints: 1 };
let regionsGeoJson: RegionFeatureCollection = { type: 'FeatureCollection', features: [] };
$: regionsGeoJson = {
type: 'FeatureCollection',
features: regions.map((r) => regionToFeature(r)).filter((f): f is RegionFeature => f !== null)
};
$: {
// Explicitly depend on visitedRegions to trigger reactivity when visit status changes
visitedRegions;
regionsGeoJson = {
type: 'FeatureCollection',
features: regions.map((r) => regionToFeature(r)).filter((f): f is RegionFeature => f !== null)
};
}
function getMarkerProps(feature: any): RegionFeatureProperties | null {
return feature && feature.properties ? feature.properties : null;