Skip to content

Commit

Permalink
Merge pull request #177 from monzo/limit-hours
Browse files Browse the repository at this point in the history
Limit the closing incident notification to working hours
  • Loading branch information
Chris authored Nov 5, 2019
2 parents ed1f72f + 9a6cea4 commit 094ccd6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions response/slack/incident_notifications.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ def remind_close_incident(incident: Incident):
if datetime.now().weekday() in (5, 6):
return

# Only remind during the day to prevent alerting people at unsociable hours
if datetime.now().hour not in range(9, 18):
return

try:
comms_channel = CommsChannel.objects.get(incident=incident)
if not incident.is_closed():
Expand Down

0 comments on commit 094ccd6

Please sign in to comment.