Skip to content

Commit

Permalink
reset cooldown after a successful send, not before
Browse files Browse the repository at this point in the history
  • Loading branch information
jontsai committed Jul 9, 2015
1 parent 43c6e96 commit 8dbe5b5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions emails.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ def send_emails(self):
# cooldown has not elapsed yet, don't send mail too frequently
pass
else:
# cache right before we send, since each send operation costs a non-zero overhead
self.reset_cooldown(recipient)
self.send_email(recipient)
# cache right after we send, since we want to guarantee
# each send operation costs a non-zero overhead,
self.reset_cooldown(recipient)

0 comments on commit 8dbe5b5

Please sign in to comment.