mirror of
https://github.com/seanmorley15/AdventureLog.git
synced 2026-05-09 07:25:01 -04:00
feat: enhance periodic sync logging and improve airport mode handling in LocationSearchMap
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user