Skip to content

Commit

Permalink
TimeoutLock.__exit__() fixed to correctly generate a stack in the log…
Browse files Browse the repository at this point in the history
… file.
  • Loading branch information
pbugni committed Jan 11, 2024
1 parent e53c159 commit aecf740
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions portal/timeout_lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,8 @@ def __exit__(self, exc_type, exc_value, traceback):
# To avoid interrupting iterative lock use, return truthy
# value to stop exception propagation - see PEP
if exc_type is not None:
error_message = f"{exc_type}"
if exc_value:
error_message += f": {exc_value}"
if traceback:
error_message += f"; {traceback}"
current_app.logger.error(error_message)
current_app.logger.exception(
"TimeoutLock trapped exception:", exc_info=True)
return True

def is_locked(self):
Expand Down

0 comments on commit aecf740

Please sign in to comment.