@@ -420,7 +420,6 @@ def should_post_to_slack(auth: dict = Depends(ip_whitelist_or_auth), request: Re
420420 time_diff = abs ((schedule_time_local - current_time_local ).total_seconds () / 60 )
421421 time_diff_rounded = ceil (time_diff )
422422
423- # TODO: walk back to 5-10 minutes vs. 90 minutes
424423 # Check if current time is within n minutes of scheduled time
425424 should_post = time_diff_rounded <= 90
426425
@@ -455,27 +454,6 @@ def post_slack(
455454
456455 check_auth (auth )
457456
458- # TODO: debug
459- # should_post_result = should_post_to_slack()
460-
461- # if isinstance(should_post_result, dict):
462- # if not should_post_result.get("should_post", False) and not override:
463- # time_diff = should_post_result.get("time_diff_minutes")
464- # current_time = arrow.get(should_post_result.get("current_time"), "dddd HH:mm ZZZ").to(tz).format("dddd HH:mm ZZZ")
465- # schedule_time = arrow.get(should_post_result.get("schedule_time"), "dddd HH:mm ZZZ").to(tz).format("dddd HH:mm ZZZ")
466-
467- # return {
468- # "message": "Not scheduled to post at this time",
469- # "reason": f"Time difference: {time_diff} minutes",
470- # "current_time": current_time,
471- # "scheduled_time": schedule_time,
472- # }
473- # elif isinstance(should_post_result, bool):
474- # if not should_post_result and not override:
475- # return {"message": "Not scheduled to post at this time", "reason": "Schedule check returned False"}
476- # else:
477- # return {"message": "Error checking schedule", "reason": "Unexpected return type from should_post_to_slack"}
478-
479457 get_events (location = location , exclusions = exclusions )
480458
481459 # open json file and convert to list of strings
0 commit comments