mirror of https://github.com/jumpserver/jumpserver
fix(invalid connection again) 定期处理长时间连接
1. 减少了处理时间间隔 2. 处理策略更改为 超过 1小时没有动的连接就干掉pull/104/head
parent
5d28a6e402
commit
3c610668b5
|
@ -91,12 +91,17 @@ def kill_invalid_connection():
|
|||
log_file_mtime = 0
|
||||
|
||||
if (now_timestamp - log_file_mtime) > 3600:
|
||||
try:
|
||||
os.kill(int(log.pid), 9)
|
||||
except OSError:
|
||||
pass
|
||||
if log.login_type == 'ssh':
|
||||
try:
|
||||
os.kill(int(log.pid), 9)
|
||||
except OSError:
|
||||
pass
|
||||
elif (now - log.start_time).days < 1:
|
||||
continue
|
||||
|
||||
log.is_finished = True
|
||||
log.end_time = now
|
||||
log.save()
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue