Skip to content

Instantly share code, notes, and snippets.

@Osmose
Created April 10, 2018 21:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Osmose/c43d1eb960e0c9a30afb240ce1f672be to your computer and use it in GitHub Desktop.
Save Osmose/c43d1eb960e0c9a30afb240ce1f672be to your computer and use it in GitHub Desktop.
def should_notify_florian(user, event, issue):
# is_new means is this the first event for this issue
return not user.has_been_notified_about(issue) and issue.is_new and event.module in [
'resource://file/i/own.jsm'
]
def should_notify_top_crasher(user, event, issue):
app_build_id = get_latest_build_id()
return not user.has_been_notified_about(issue) and issue.get_rank(app_build_id=app_build_id) <= 10
def should_notify_rapid_growth(user, event, issue):
an_hour_ago = datetime.now() - timedelta(hour=1)
return not user.has_been_notified_about(issue) and issue.events_since(an_hour_ago) > 100
def should_notify_many_users(user, event, issue):
return not user.has_been_notified_about(issue) and issue.users_affected > 1000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment