From ecfe7381977787a6bfa09c6c96d99c315265e284 Mon Sep 17 00:00:00 2001 From: Bernard Blackham Date: Thu, 12 Aug 2004 09:44:57 +0000 Subject: [PATCH] Random idler fixes. --- sql-edition/servers/Idler.py | 2 +- sql-edition/servers/VendServer.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sql-edition/servers/Idler.py b/sql-edition/servers/Idler.py index 555630f..5ffea0b 100755 --- a/sql-edition/servers/Idler.py +++ b/sql-edition/servers/Idler.py @@ -178,4 +178,4 @@ class GrayIdler(Idler): self.i = 0 self.grayCode = 0 if self.reorder: - self.reorder = int(random()*40320) + self.reorder = int(random()*40319)+1 diff --git a/sql-edition/servers/VendServer.py b/sql-edition/servers/VendServer.py index 992a65d..45288f1 100755 --- a/sql-edition/servers/VendServer.py +++ b/sql-edition/servers/VendServer.py @@ -278,11 +278,11 @@ def run_forever(rfh, wfh, options, cf): time_to_autologout = time() + 15 if time_to_idle == None and cur_user == '': - time_to_idle = time() + 30 + time_to_idle = time() + 5 choose_idler() - if time_to_idle != None and cur_user != '': time_to_idle = None + if time_to_idle is not None and cur_user != '': time_to_idle = None if time_to_idle is not None and time() > time_to_idle: idle_step() - if time() > time_to_idle + 300: + if time_to_idle is not None and time() > time_to_idle + 300: time_to_idle = time() choose_idler() -- 2.20.1