aboutsummaryrefslogtreecommitdiff
path: root/src/hydrilla/proxy/state_impl/base.py
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2022-09-09 11:58:42 +0200
committerWojtek Kosior <koszko@koszko.org>2022-09-28 14:03:18 +0200
commit5e89f6d59cf63fcd0c421ea546d4d2fc21bdf574 (patch)
tree04ee13d13719c39189925674f47a05c5ab930ba7 /src/hydrilla/proxy/state_impl/base.py
parentbeb163cfd15b93bf664b6a0590e114d4432e3ef9 (diff)
downloadhaketilo-hydrilla-5e89f6d59cf63fcd0c421ea546d4d2fc21bdf574.tar.gz
haketilo-hydrilla-5e89f6d59cf63fcd0c421ea546d4d2fc21bdf574.zip
[proxy] guard more code with lock in Haketilo state implementation
Diffstat (limited to 'src/hydrilla/proxy/state_impl/base.py')
-rw-r--r--src/hydrilla/proxy/state_impl/base.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/hydrilla/proxy/state_impl/base.py b/src/hydrilla/proxy/state_impl/base.py
index 75d733f..f969b19 100644
--- a/src/hydrilla/proxy/state_impl/base.py
+++ b/src/hydrilla/proxy/state_impl/base.py
@@ -153,10 +153,10 @@ class HaketiloStateWithFields(st.HaketiloState):
@contextmanager
def cursor(self, transaction: bool = False) \
-> t.Iterator[sqlite3.Cursor]:
- """...."""
- start_transaction = transaction and not self.connection.in_transaction
-
with self.lock:
+ start_transaction = \
+ transaction and not self.connection.in_transaction
+
if self.current_cursor is not None:
yield self.current_cursor
return