mirror of https://github.com/jumpserver/jumpserver
修复无法终结web进程的bug
parent
e60a3a697e
commit
7ea23e0fcc
|
@ -29,7 +29,7 @@ import struct, fcntl, signal, socket, select, fnmatch
|
||||||
|
|
||||||
import paramiko
|
import paramiko
|
||||||
from connect import Tty
|
from connect import Tty
|
||||||
from connect import TtyLog
|
from connect import TtyLog, Log
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import simplejson as json
|
import simplejson as json
|
||||||
|
@ -186,11 +186,11 @@ class WebTty(Tty):
|
||||||
class WebTerminalKillHandler(tornado.web.RequestHandler):
|
class WebTerminalKillHandler(tornado.web.RequestHandler):
|
||||||
def get(self):
|
def get(self):
|
||||||
ws_id = self.get_argument('id')
|
ws_id = self.get_argument('id')
|
||||||
|
Log.objects.filter(id=ws_id).update(is_finished=True)
|
||||||
for ws in WebTerminalHandler.clients:
|
for ws in WebTerminalHandler.clients:
|
||||||
print ws.id
|
print ws.id
|
||||||
if ws.id == int(ws_id):
|
if ws.id == int(ws_id):
|
||||||
print "killed"
|
print "killed"
|
||||||
ws.log.is_finished = True
|
|
||||||
ws.log.save()
|
ws.log.save()
|
||||||
ws.close()
|
ws.close()
|
||||||
print len(WebTerminalHandler.clients)
|
print len(WebTerminalHandler.clients)
|
||||||
|
|
Loading…
Reference in New Issue