提交 6c853fc7 authored 作者: Seven Du's avatar Seven Du

auto subscribe to background_job when use bgapi

上级 74dae33b
...@@ -716,11 +716,13 @@ App.usersController = Ember.ArrayController.create({ ...@@ -716,11 +716,13 @@ App.usersController = Ember.ArrayController.create({
App.initialize(); App.initialize();
var global_debug_event = false; var global_debug_event = false;
var global_background_job = false;
function eventCallback(data) { function eventCallback(data) {
console.log(data["Event-Name"]); console.log(data["Event-Name"]);
if (global_debug_event) { if (global_debug_event ||
(global_background_job && data["Event-Name"] == "BACKGROUND_JOB")) {
console.log(data); console.log(data);
} }
...@@ -800,6 +802,10 @@ function api(cmdstr) ...@@ -800,6 +802,10 @@ function api(cmdstr)
//execute bgapi //execute bgapi
function bgapi(cmd) function bgapi(cmd)
{ {
if (!global_background_job) {
socket.send("event json BACKGROUND_JOB");
global_background_job = true;
}
api("bgapi " + cmd); api("bgapi " + cmd);
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论