add timeout constant, set to 5 minutes

This commit is contained in:
Anthony Young 2011-01-03 10:57:35 -08:00
parent 8df8dd5ced
commit b289812d38
1 changed files with 3 additions and 2 deletions

View File

@ -12,6 +12,7 @@ import qweb
import string, subprocess, uuid
global g_server
TIMEOUT=300
class Terminal:
def __init__(self,width=80,height=24):
@ -434,7 +435,7 @@ class Multiplex:
t=time.time()
for i in self.proc.keys():
t0=self.proc[i]['time']
if (t-t0)>120:
if (t-t0)>TIMEOUT:
try:
os.close(i)
os.kill(self.proc[i]['pid'],signal.SIGTERM)
@ -465,7 +466,7 @@ class Multiplex:
while self.run():
fds=self.fds()
i,o,e=select.select(fds, [], [], 1.0)
if time.time() - self.lastActivity > 120:
if time.time() - self.lastActivity > TIMEOUT:
global g_server
g_server.shutdown()
for fd in i: