Skip to content

Commit 45c5134

Browse files
committed
use quit timer to close clients (100ms)
1 parent 06b07d0 commit 45c5134

File tree

1 file changed

+15
-14
lines changed

1 file changed

+15
-14
lines changed

src/ray-deamon

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -926,10 +926,10 @@ class OperatingSession(Session):
926926
self.timer_launch.timeout.connect(self.timerLaunchTimeOut)
927927
self.clients_to_launch = []
928928

929-
self.timer_stop = QTimer()
930-
self.timer_stop.setInterval(100)
931-
self.timer_stop.timeout.connect(self.timerStopTimeOut)
932-
self.clients_to_stop = []
929+
self.timer_quit = QTimer()
930+
self.timer_quit.setInterval(100)
931+
self.timer_quit.timeout.connect(self.timerQuitTimeOut)
932+
self.clients_to_quit = []
933933

934934
self.err_loading = ERR_OK
935935
self.err_saving = ERR_OK
@@ -1009,14 +1009,14 @@ class OperatingSession(Session):
10091009
if not self.clients_to_launch:
10101010
self.timer_launch.stop()
10111011

1012-
def timerStopTimeOut(self):
1013-
if self.clients_to_stop:
1012+
def timerQuitTimeOut(self):
1013+
if self.clients_to_quit:
10141014
waitForJack()
1015-
self.clients_to_stop[0].stop()
1016-
self.clients_to_stop.__delitem__(0)
1015+
self.clients_to_quit[0].quit()
1016+
self.clients_to_quit.__delitem__(0)
10171017

1018-
if not self.clients_to_stop:
1019-
self.timer_stop.stop()
1018+
if not self.clients_to_quit:
1019+
self.timer_quit.stop()
10201020

10211021
def sendError(self, err, error_message):
10221022
#clear process order to allow other new operations
@@ -1155,16 +1155,18 @@ class OperatingSession(Session):
11551155
self.expected_clients.clear()
11561156
self.removed_clients.clear()
11571157

1158-
if not self.path:
1158+
if not self.path:
11591159
self.nextFunction()
11601160
return
11611161

11621162
server.setServerStatus(SERVER_STATUS_CLOSE)
11631163

1164-
for client in self.clients:
1164+
for client in self.clients.__reversed__():
11651165
if client.isRunning():
11661166
self.expected_clients.append(client)
1167-
client.quit()
1167+
#client.quit()
1168+
self.clients_to_quit.append(client)
1169+
self.timer_quit.start()
11681170

11691171
self.waitAndGoTo(30000, self.close_step1, WAIT_FOR_STOP)
11701172

@@ -1529,7 +1531,6 @@ class OperatingSession(Session):
15291531
#* to give up waiting on them fairly soon. */
15301532

15311533
self.timer_launch.start()
1532-
#wait_time_announce = 5000 + (len(self.expected_clients)*100)
15331534

15341535
self.reOrderClients(new_client_id_list)
15351536
server.sendGui('/ray/gui/clients_reordered', *new_client_id_list)

0 commit comments

Comments
 (0)