Created
April 10, 2018 21:22
-
-
Save Osmose/c43d1eb960e0c9a30afb240ce1f672be to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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