fixed issues with shutting down a distributed batch mode
This commit is contained in:
parent
5b36181956
commit
ea4f6ba518
2 changed files with 11 additions and 8 deletions
|
@ -241,12 +241,13 @@ class Session(object):
|
|||
time.ctime()))
|
||||
self.writestate(state)
|
||||
self.runhook(state)
|
||||
if self.isconnected() and sendevent:
|
||||
if sendevent:
|
||||
tlvdata = ""
|
||||
tlvdata += coreapi.CoreEventTlv.pack(coreapi.CORE_TLV_EVENT_TYPE,
|
||||
state)
|
||||
msg = coreapi.CoreEventMessage.pack(0, tlvdata)
|
||||
# send Event Message to connected handlers (e.g. GUI)
|
||||
if self.isconnected():
|
||||
try:
|
||||
if returnevent:
|
||||
replies.append(msg)
|
||||
|
|
|
@ -1245,6 +1245,8 @@ class CoreRequestHandler(SocketServer.BaseRequestHandler):
|
|||
self.info("request to terminate session %s" % sid)
|
||||
session.setstate(state=coreapi.CORE_EVENT_DATACOLLECT_STATE,
|
||||
info=True, sendevent=True)
|
||||
session.setstate(state=coreapi.CORE_EVENT_SHUTDOWN_STATE,
|
||||
info=True, sendevent=True)
|
||||
session.shutdown()
|
||||
else:
|
||||
self.warn("unhandled session flags for session %s" % sid)
|
||||
|
|
Loading…
Reference in a new issue