Skip to content

Commit 3ffc38f

Browse files
committed
fix bug in server
1 parent ee05b12 commit 3ffc38f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Base/Server.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def run(self):
140140
start_time_cycle = time.time()
141141

142142
self.receive_action = 0
143-
while (Conf.sync_mode and (self.receive_action < Conf.agent_numbers or time.time() - start_time_cycle < Conf.think_time * 10)) \
143+
while (Conf.sync_mode and (self.receive_action < Conf.agent_numbers)) \
144144
or (not Conf.sync_mode and time.time() - start_time_cycle < Conf.think_time):
145145
try:
146146
msg = self.action_queue.get(block=True, timeout=0.001)
@@ -152,6 +152,8 @@ def run(self):
152152
except:
153153
continue
154154
self.action_parse(msg)
155+
if Conf.sync_mode and (time.time() - start_time_cycle > Conf.think_time * 10):
156+
break
155157

156158
while self.action_queue.qsize() > 0:
157159
self.action_queue.get()

0 commit comments

Comments
 (0)