From b289812d388cf8e612ddff5ea13f7dc41a6bc359 Mon Sep 17 00:00:00 2001 From: Anthony Young Date: Mon, 3 Jan 2011 10:57:35 -0800 Subject: add timeout constant, set to 5 minutes --- tools/ajaxterm/ajaxterm.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/ajaxterm/ajaxterm.py b/tools/ajaxterm/ajaxterm.py index e2c156fd7..bf27b264a 100755 --- a/tools/ajaxterm/ajaxterm.py +++ b/tools/ajaxterm/ajaxterm.py @@ -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: -- cgit