From fd95f2d4d71dd1f0add5b4eaf88a3c055cdccd80 Mon Sep 17 00:00:00 2001 From: Vin Bui <75594943+vinnie4k@users.noreply.github.com> Date: Sat, 6 Jan 2024 22:25:17 -0600 Subject: [PATCH] Add logger info (#128) * Fixed weekday alignment issues * Fixed override issue --- app.py | 3 +++ src/scrapers/sp_hours_scraper.py | 9 +++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app.py b/app.py index 77f657c..8e78170 100644 --- a/app.py +++ b/app.py @@ -21,6 +21,9 @@ scheduler.init_app(app) scheduler.start() +# Logging +logging.basicConfig(format="%(asctime)s %(levelname)-8s %(message)s", level=logging.INFO, datefmt="%Y-%m-%d %H:%M:%S") + @app.route("/") def index(): diff --git a/src/scrapers/sp_hours_scraper.py b/src/scrapers/sp_hours_scraper.py index f218048..2ed147f 100644 --- a/src/scrapers/sp_hours_scraper.py +++ b/src/scrapers/sp_hours_scraper.py @@ -45,9 +45,9 @@ def fetch_sp_facility(): # Check if hours exist and is within next 7 days if hours and within_week(date): - if hours == MARKER_CLOSED: - clean_hours(date, get_facility_id(name)) - else: + # Clean hours from database + clean_hours(date, get_facility_id(name)) + if hours != MARKER_CLOSED: parse_special_hours(hours, type, date, get_facility_id(name)) @@ -101,9 +101,6 @@ def add_special_facility_hours(start_time, end_time, facility_id, court_type=Non start_unix = unix_time(start_time) end_unix = unix_time(end_time) - # Clean hours from database - clean_hours(start_time, facility_id) - # Create hours hrs = OpenHours( end_time=end_unix,