From 51c48df4aa502deee82c846856d7693c2d9009ea Mon Sep 17 00:00:00 2001 From: Fengyuan Zhang Date: Thu, 11 Jul 2024 16:22:11 +0800 Subject: [PATCH] update 7bin codes --- controls/dataExServer.js | 6 ++++++ routes/server/index.js | 30 ++++++++++++++++++++++++++++++ routes/task/index.js | 22 +++++++++++----------- 3 files changed, 47 insertions(+), 11 deletions(-) diff --git a/controls/dataExServer.js b/controls/dataExServer.js index e6decfd..6a09cf9 100644 --- a/controls/dataExServer.js +++ b/controls/dataExServer.js @@ -19,6 +19,12 @@ DataExServersCtrl.init = function () { console.log('DataExServers timer started!'); var rule = new Schedule.RecurrenceRule(); + // 启动的时候先检测一次 + DataExServersCtrl.getAll(function (err, items) { + checkDataExServer(items).then(r => + console.log("check data container status finished at : " + new Date())); + }) + // 每15分钟执行一次 rule.minute = [0,15,30,45]; diff --git a/routes/server/index.js b/routes/server/index.js index 3c83ee7..c17179e 100644 --- a/routes/server/index.js +++ b/routes/server/index.js @@ -621,4 +621,34 @@ module.exports = function (app) { } }) }) + + // add by qbin at 2024.03.01 获取部署了指定模型的节点列表 + app.route('/server/modelser/:pid') + .get(function(req, res, next){ + var pid = req.params.pid; + ServersCtrl.getByPID(pid, function (err, servers) { + if (err) { + return res.end(JSON.stringify({ + result: 'err', + code: -1, + message: err.message, + data: '' + })); + } + + var deployedServers = []; + + servers.forEach(function(server){ + deployedServers.push(server.s_ip); + }) + + return res.end(JSON.stringify({ + result: 'suc', + code: 1, + message: '', + data: deployedServers + })); + + }) + }) } \ No newline at end of file diff --git a/routes/task/index.js b/routes/task/index.js index 07962a7..6eaff5e 100644 --- a/routes/task/index.js +++ b/routes/task/index.js @@ -23,21 +23,21 @@ module.exports = function (app) { }); - app.route('/task/testTransferOutputUrl') - .get(function (req, res, next) { + // app.route('/task/testTransferOutputUrl') + // .get(function (req, res, next) { - var url = "http://175.27.137.60:8082/data/0eb70489-f9bc-43bf-879d-d32ffd9459a5?pwd=" - if (url != null && url !== ""){ - // 把内网ip换成外网可以访问的地址,供外网下载 - // url = url.replace("172.21.212.20:8082", Setting.dataContainerIpAndPort.website); - url = url.replace("221.226.60.2:8082", Setting.dataContainerIpAndPort.website); - url = url.replace("175.27.137.60:8082", Setting.dataContainerIpAndPort.website); - } + // var url = "http://175.27.137.60:8082/data/0eb70489-f9bc-43bf-879d-d32ffd9459a5?pwd=" + // if (url != null && url !== ""){ + // // 把内网ip换成外网可以访问的地址,供外网下载 + // // url = url.replace("172.21.212.20:8082", Setting.dataContainerIpAndPort.website); + // url = url.replace("221.226.60.2:8082", Setting.dataContainerIpAndPort.website); + // url = url.replace("175.27.137.60:8082", Setting.dataContainerIpAndPort.website); + // } - res.end("ok:" + url); - }); + // res.end("ok:" + url); + // }); app.route('/task/testUpdateStatus') -- Gitee