Skip to content

Commit 16cf332

Browse files
committed
bridge stop bug fix
1 parent f6e7f88 commit 16cf332

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

backend/syslogger/bridge.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,13 @@ def stop(self, reason="stopped", automated_thread=True):
141141
time.sleep(2)
142142
self.__automated_threads = not automated_thread
143143
self.__lock.release()
144-
while self.__auto_delete_thread_stopped:
144+
while not self.__auto_delete_thread_stopped:
145145
time.sleep(0.1)
146-
while self.__auto_space_checker_thread_stopped:
146+
while not self.__auto_space_checker_thread_stopped:
147147
time.sleep(0.1)
148148
if self.__debug:
149149
self.__debug_thread = False
150-
while self.__debug_thread_stopped:
150+
while not self.__debug_thread_stopped:
151151
time.sleep(0.1)
152152
self.__engine = None
153153
self.__db_hook = None
@@ -416,9 +416,8 @@ def __pause_bridge_because_of_no_space(self):
416416
previous_time_s = 0
417417
while True:
418418
if not self.__automated_threads:
419-
with self.__lock:
420-
self.__auto_space_checker_thread_stopped = True
421-
return
419+
self.__auto_space_checker_thread_stopped = True
420+
return
422421
current_time_s = int(time.time())
423422
if current_time_s - previous_time_s > 5:
424423
previous_time_s = int(current_time_s)
@@ -439,9 +438,8 @@ def __auto_delete_old_files(self):
439438
previous_time_s = 0
440439
while True:
441440
if not self.__automated_threads:
442-
with self.__lock:
443-
self.__auto_delete_thread_stopped = True
444-
return
441+
self.__auto_delete_thread_stopped = True
442+
return
445443
current_time_s = int(time.time())
446444
if current_time_s - previous_time_s > 5:
447445
previous_time_s = int(current_time_s)

0 commit comments

Comments
 (0)