From ec909f9c435fc0d8fcbbb3cf1daf76b2cd61ae4a Mon Sep 17 00:00:00 2001 From: Weather Date: Thu, 3 Sep 2026 22:45:41 -0400 Subject: [PATCH 1/2] fix: Correct ordering --- src/config.py | 2 +- src/core/announcement_queue.py | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/config.py b/src/config.py index d6ac12d..9e43a5f 100644 --- a/src/config.py +++ b/src/config.py @@ -38,7 +38,7 @@ def _get_env_variable(name: str, default: str | None = None) -> str | Any: BASE_DIR: str = os.path.dirname(os.path.abspath(__file__)) -SLACK_MEETINGS_KEYWORD: str = _get_env_variable("SLACK_MEETINGS_KEYWORD", "meetings") +SLACK_MEETINGS_KEYWORD: str = _get_env_variable("SLACK_MEETINGS_KEYWORD", "meeting") SLACK_NONTECHNICAL_SEMINAR_KEYWORD: str = _get_env_variable("SLACK_NONTECHNICAL_SEMINAR_KEYWORD", "non-technical") SLACK_TECHNICAL_SEMINAR_KEYWORD: str = _get_env_variable("SLACK_TECHNICAL_SEMINAR_KEYWORD", "technical") diff --git a/src/core/announcement_queue.py b/src/core/announcement_queue.py index e874707..ddd9e7d 100644 --- a/src/core/announcement_queue.py +++ b/src/core/announcement_queue.py @@ -32,7 +32,6 @@ TEN_MINUTES = 60 * 10 MINUTES_BEFORE_EVENT_PING = 15 - async def create_announcement_worker( event_uid: str, event_recurrence_id: str, text: str, event_time: datetime ) -> None: @@ -133,34 +132,35 @@ def check_for_announcement(event: dict[str, Any], time: datetime) -> None: loc = event.get("LOCATION", None) description = description.lower().strip() - if SLACK_NONTECHNICAL_SEMINAR_KEYWORD.lower() in description: + + if SLACK_TECHNICAL_SEMINAR_KEYWORD.lower() in description: if loc: queue_announcement( uid, rec_id, - f" The Technical Seminar {title} will be happening in the {loc} in {MINUTES_BEFORE_EVENT_PING} minutes!", + f" The Non-Technical Seminar {title} will be happening in the {loc} in {MINUTES_BEFORE_EVENT_PING} minutes!", time, ) else: queue_announcement( uid, rec_id, - f" The Technical Seminar {title} will be happening in {MINUTES_BEFORE_EVENT_PING} minutes!", + f" The Non-Technical Seminar {title} will be happening in {MINUTES_BEFORE_EVENT_PING} minutes!", time, ) - elif SLACK_TECHNICAL_SEMINAR_KEYWORD.lower() in description: + elif SLACK_NONTECHNICAL_SEMINAR_KEYWORD.lower() in description: if loc: queue_announcement( uid, rec_id, - f" The Non-Technical Seminar {title} will be happening in the {loc} in {MINUTES_BEFORE_EVENT_PING} minutes!", + f" The Technical Seminar {title} will be happening in the {loc} in {MINUTES_BEFORE_EVENT_PING} minutes!", time, ) else: queue_announcement( uid, rec_id, - f" The Non-Technical Seminar {title} will be happening in {MINUTES_BEFORE_EVENT_PING} minutes!", + f" The Technical Seminar {title} will be happening in {MINUTES_BEFORE_EVENT_PING} minutes!", time, ) elif SLACK_MEETINGS_KEYWORD.lower() in description: From b65de2be0658c92ab592bdce4a894d91af971422 Mon Sep 17 00:00:00 2001 From: Weather Date: Thu, 3 Sep 2026 22:51:17 -0400 Subject: [PATCH 2/2] fix: idk why vscode is doing --- src/core/announcement_queue.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/core/announcement_queue.py b/src/core/announcement_queue.py index ddd9e7d..3166f3d 100644 --- a/src/core/announcement_queue.py +++ b/src/core/announcement_queue.py @@ -32,6 +32,9 @@ TEN_MINUTES = 60 * 10 MINUTES_BEFORE_EVENT_PING = 15 +logger.info(SLACK_MEETINGS_KEYWORD) +logger.info(SLACK_TECHNICAL_SEMINAR_KEYWORD) + async def create_announcement_worker( event_uid: str, event_recurrence_id: str, text: str, event_time: datetime ) -> None: @@ -46,6 +49,7 @@ async def create_announcement_worker( """ key: str = f"{event_uid}:{event_recurrence_id}" # we should use redis instead + logger.info(key) current_time: datetime = datetime.now(ZoneInfo(CALENDAR_TIMEZONE)) if current_time < (event_time - timedelta(minutes=MINUTES_BEFORE_EVENT_PING)): wait_time = ( @@ -133,7 +137,7 @@ def check_for_announcement(event: dict[str, Any], time: datetime) -> None: description = description.lower().strip() - if SLACK_TECHNICAL_SEMINAR_KEYWORD.lower() in description: + if SLACK_NONTECHNICAL_SEMINAR_KEYWORD.lower() in description: if loc: queue_announcement( uid, @@ -148,7 +152,7 @@ def check_for_announcement(event: dict[str, Any], time: datetime) -> None: f" The Non-Technical Seminar {title} will be happening in {MINUTES_BEFORE_EVENT_PING} minutes!", time, ) - elif SLACK_NONTECHNICAL_SEMINAR_KEYWORD.lower() in description: + elif SLACK_TECHNICAL_SEMINAR_KEYWORD.lower() in description: if loc: queue_announcement( uid,