File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -23,8 +23,12 @@ def _init(self):
23
23
self .start_process ()
24
24
25
25
def exists (self ):
26
+ if not os .path .exists (self .socket_path ):
27
+ self .close ()
28
+ return False
29
+
26
30
if settings .production :
27
- return os . path . exists ( self . socket_path )
31
+ return True
28
32
29
33
process = False
30
34
for proc in psutil .process_iter ():
@@ -92,7 +96,8 @@ def close(self):
92
96
break
93
97
except (psutil .AccessDenied , psutil .ZombieProcess , psutil .NoSuchProcess ):
94
98
continue
95
- os .remove (self .socket_path )
99
+ if os .path .exists (self .socket_path ):
100
+ os .remove (self .socket_path )
96
101
97
102
98
103
class IpcControllerSingleton :
Original file line number Diff line number Diff line change @@ -48,6 +48,8 @@ def worker(client_socket):
48
48
data = client_socket .recv (10 * 1024 * 1024 )
49
49
response = handle_request (data )
50
50
client_socket .sendall (response )
51
+ except Exception as e :
52
+ client_socket .sendall (json .dumps (str (e )).encode ())
51
53
finally :
52
54
client_socket .close ()
53
55
You can’t perform that action at this time.
0 commit comments