Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check_api Checks Same Week/Date Range Twice #46

Open
ThorntonMatthewD opened this issue Oct 24, 2023 · 0 comments
Open

check_api Checks Same Week/Date Range Twice #46

ThorntonMatthewD opened this issue Oct 24, 2023 · 0 comments

Comments

@ThorntonMatthewD
Copy link
Collaborator

ThorntonMatthewD commented Oct 24, 2023

Screenshot_2023-10-24_00-33-49

slack-events-bot/src/bot.py

Lines 131 to 136 in f8b800e

# keep current week's post up to date
await parse_events_for_week(today, resp)
# potentially post next week 5 days early
probe_date = today + datetime.timedelta(days=5)
await parse_events_for_week(probe_date, resp)

At certain points during the week the above code will cause parse_events_for_week to be called with probe_date values that end up causing the same week to have messages posted/updated for it twice.

I think it would be good to check for the overlap or some other condition before firing off the second, lookahead function execution on L136.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant