up extractor env getting

This commit is contained in:
Tykayn 2025-09-18 22:30:25 +02:00 committed by tykayn
parent 4951eeb1c8
commit 153e9bd8f9
11 changed files with 196 additions and 4 deletions

View file

@ -414,11 +414,18 @@ def submit_event(event):
def main():
"""
Main function to fetch OSM Calendar events and add them to the database.
The function will exit if the .env file doesn't exist, as it's required
for database connection parameters.
"""
logger.info("Starting OSM Calendar extractor")
# Load environment variables from .env file if it exists
load_env_from_file()
# Load environment variables from .env file and check if it exists
if not load_env_from_file():
logger.error("Required .env file not found. Exiting.")
sys.exit(1)
logger.info("Environment variables loaded successfully from .env file")
# Fetch events from the OSM Calendar RSS feed
items = fetch_osm_calendar_data()