kopia lustrzana https://github.com/jbruce12000/kiln-controller
adding stats api call
rodzic
dcd722ad5f
commit
62c2d793aa
|
@ -13,7 +13,6 @@ from gevent.pywsgi import WSGIServer
|
|||
from geventwebsocket.handler import WebSocketHandler
|
||||
from geventwebsocket import WebSocketError
|
||||
|
||||
|
||||
try:
|
||||
sys.dont_write_bytecode = True
|
||||
import config
|
||||
|
@ -79,6 +78,13 @@ def handle_api():
|
|||
log.info("api stop command received")
|
||||
oven.abort_run()
|
||||
|
||||
# get stats during a run
|
||||
if bottle.request.json['cmd'] == 'stats':
|
||||
log.info("api stats command received")
|
||||
if hasattr(oven,'pid'):
|
||||
if hasattr(oven.pid,'pidstats'):
|
||||
return json.dumps(oven.pid.pidstats)
|
||||
|
||||
return { "success" : True }
|
||||
|
||||
def find_profile(wanted):
|
||||
|
|
Ładowanie…
Reference in New Issue