Skip to content

Commit c9e59bc

Browse files
committed
use global lock for update, ok from @janste63
1 parent 27aba03 commit c9e59bc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/cryptojwt/key_bundle.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@
4747

4848
MAP = {"dec": "enc", "enc": "enc", "ver": "sig", "sig": "sig"}
4949

50+
update_lock = threading.Lock()
51+
5052

5153
def harmonize_usage(use):
5254
"""
@@ -508,7 +510,7 @@ def update(self):
508510
:return: True if update was ok or False if we encountered an error during update.
509511
"""
510512
if self.source:
511-
with threading.Lock():
513+
with update_lock:
512514
_old_keys = self._keys # just in case
513515

514516
# reread everything

0 commit comments

Comments
 (0)