Raise TransactionActive instead of returning False.

This commit is contained in:
voussoir 2025-03-24 22:15:58 -07:00
parent 9385b365cd
commit 924e5b4bdc

View file

@ -227,7 +227,7 @@ class Database(metaclass=abc.ABCMeta):
# time here. # time here.
thread_id = threading.current_thread().ident thread_id = threading.current_thread().ident
if self._worms_transaction_owner == thread_id: if self._worms_transaction_owner == thread_id:
return False raise TransactionActive()
log.loud(f'{thread_id} wants the transaction lock.') log.loud(f'{thread_id} wants the transaction lock.')
self._worms_transaction_lock.acquire() self._worms_transaction_lock.acquire()