Added idle timeout code to help combat the screwed up session situation. Some admins would've wanted this eventually, but it'll help until I figure out how to close dead sessions that look like they're still alive. Added a new server config directive, idle_timeout. If the value is non-zero, the idle timeout is the respective number of seconds between commands. Also, the IDLE command will save you from idle timeouts but won't modify your publicly visible idle time.
This commit is contained in:
parent
32fa9e419a
commit
f1dd985294
6 changed files with 34 additions and 11 deletions
|
|
@ -1,3 +1,4 @@
|
|||
from traceback import format_exc
|
||||
from asyncore import dispatcher
|
||||
from asynchat import async_chat
|
||||
import socket, asyncore, time
|
||||
|
|
@ -128,5 +129,6 @@ if __name__ == '__main__':
|
|||
print '--> Server killed by keystroke.'
|
||||
|
||||
except:
|
||||
server.shutdown(message="The server has encountered an error and has been shut down. Please check back soon.")
|
||||
print '-!> Server crashed.'
|
||||
server.shutdown(message="The server has encountered a fatal error and has been shut down. Please check back soon.")
|
||||
functions_general.log_errmsg("Untrapped error: %s" %
|
||||
(format_exc()))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue