Skip to content

Commit

Permalink
Only send if we acquire a lock
Browse files Browse the repository at this point in the history
Closes #69
  • Loading branch information
paltman committed Jan 30, 2018
1 parent f3f2ecc commit 808ef6b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
3 changes: 3 additions & 0 deletions pinax/notifications/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ def acquire_lock(*args):

def send_all(*args):
lock = acquire_lock(*args)
if lock is None:
logging.debug("no lock acquired. skipping sending.")
return
batches, sent, sent_actual = 0, 0, 0
start_time = time.time()

Expand Down
7 changes: 0 additions & 7 deletions pinax/notifications/tests/tests.py

This file was deleted.

0 comments on commit 808ef6b

Please sign in to comment.