Feat: Add some logging.
build_develop / build (push) Successful in 43s

Trying to figure out why the elections are not starting.
This commit is contained in:
2025-05-25 22:24:26 -04:00
parent f3985b5d21
commit 4f4d76d151
3 changed files with 23 additions and 3 deletions
+6
View File
@@ -20,6 +20,7 @@ from dakiny_bot.database.sql_data_classes import (
Votes,
engine,
)
from dakiny_bot.logger import dakiny_logger
from .DakinySettings import settings
@@ -92,12 +93,14 @@ def get_active_election_cycle() -> int:
int: cycle index for active election. None for no active cycle
"""
today = datetime.now(tz=UTC)
dakiny_logger.debug("Today is %s", today)
for cycle, election in enumerate(settings.election_cycles):
if (
today.date() >= get_datetime(election.election_start).date()
and today.date() <= get_datetime(election.term_start).date()
):
dakiny_logger.debug("Cycle is %d", cycle)
return cycle
# It isn't a current election, get the quarter
@@ -114,13 +117,16 @@ def get_quarter_cycle() -> int:
int: cycle index for current cycle.
"""
today = datetime.now(tz=UTC)
dakiny_logger.debug("Today is %s", today)
for cycle, election in enumerate(settings.election_cycles):
if (
today.date() >= get_datetime(election.term_start).date()
and today.date() <= get_datetime(election.term_end).date()
):
dakiny_logger.debug("Cycle is %d", cycle)
return cycle
dakiny_logger.debug("Quarter cycle is None.")
return None