Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jumpserver
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ops
jumpserver
Commits
3c610668
Commit
3c610668
authored
Feb 29, 2016
by
ibuler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(invalid connection again) 定期处理长时间连接
1. 减少了处理时间间隔 2. 处理策略更改为 超过 1小时没有动的连接就干掉
parent
5d28a6e4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
log_api.py
jlog/log_api.py
+9
-4
No files found.
jlog/log_api.py
View file @
3c610668
...
...
@@ -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
()
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment