Skip to content

Commit

Permalink
Merge pull request #225 from marketforce-tech/issue_223_extra_checks
Browse files Browse the repository at this point in the history
feat: Do extra checks before releasing a lock
  • Loading branch information
sibson authored Sep 18, 2022
2 parents 0768de0 + b05ca75 commit 2e1e81e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion redbeat/schedulers.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,8 @@ def tick(self, min=min, **kwargs):
def close(self):
if self.lock:
logger.info('beat: Releasing lock')
self.lock.release()
if self.lock.owned() and self.lock.locked():
self.lock.release()
self.lock = None
super().close()

Expand Down

0 comments on commit 2e1e81e

Please sign in to comment.