|
|
|
@ -191,5 +191,26 @@ module JupyterService
|
|
|
|
|
edu_setting('jupyter_service').gsub("PORT", jupyter_port)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def _jupyter_active(tpiID)
|
|
|
|
|
shixun_tomcat = edu_setting('cloud_bridge')
|
|
|
|
|
uri = "#{shixun_tomcat}/bridge/jupyter/active"
|
|
|
|
|
params = {:tpiID => tpiID}
|
|
|
|
|
res = uri_post uri, params
|
|
|
|
|
if res && res['code'].to_i != 0
|
|
|
|
|
raise("实训云平台繁忙(繁忙等级:120)")
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# tpm 延时
|
|
|
|
|
def jupyter_active_tpm(shixun)
|
|
|
|
|
tpiID = "tpm#{shixun.id}"
|
|
|
|
|
_jupyter_active(tpiID)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# tpi 延时
|
|
|
|
|
def jupyter_active_tpi(myshixun)
|
|
|
|
|
tpiID = myshixun.id
|
|
|
|
|
_jupyter_active(tpiID)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
end
|
|
|
|
|