Skip to content

Commit 31012f5

Browse files
committed
fix FileNotFoundError on server start
1 parent 01f1326 commit 31012f5

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pykeepass_cache/pykeepass_cache.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def _fork_and_run(func, *, timeout, socket_path):
9191

9292
# if server is running, connect to it
9393
try:
94-
conn = unix_connect(socket_path)
94+
conn = unix_connect(socket_path, config={'allow_all_attrs': True})
9595
return func(conn)
9696

9797
except (FileNotFoundError, ConnectionRefusedError):
@@ -126,9 +126,9 @@ def _fork_and_run(func, *, timeout, socket_path):
126126
# child process
127127
else:
128128
# FIXME: is there a more robust way to start the client after the server?
129-
# maybe wait for existence of socket_path
130-
time.sleep(1)
131-
conn = unix_connect(socket_path)
129+
while not os.path.exists(socket_path):
130+
time.sleep(0.05)
131+
conn = unix_connect(socket_path, config={'allow_all_attrs': True})
132132
return func(conn)
133133

134134

0 commit comments

Comments
 (0)