Browse Source

告警推送debug

dev
巴林闲侠 2 years ago
parent
commit
da7cd8a9bb
  1. 14
      api/app/lib/controllers/auth/index.js
  2. 2
      api/app/lib/schedule/alarms_push.js

14
api/app/lib/controllers/auth/index.js

@ -93,6 +93,20 @@ async function login (ctx, next) {
} }
} }
async function complement (ctx) {
try {
const { models } = ctx.fs.dc;
ctx.status = 20;
} catch (error) {
ctx.fs.logger.error(`path: ${ctx.path}, error: error`);
ctx.status = 400;
ctx.body = {
message: typeof error == 'string' ? error : undefined
}
}
}
async function logout (ctx) { async function logout (ctx) {
try { try {
const models = ctx.fs.dc.models; const models = ctx.fs.dc.models;

2
api/app/lib/schedule/alarms_push.js

@ -683,7 +683,7 @@ module.exports = function (app, opts) {
SELECT * FROM alarm_details SELECT * FROM alarm_details
WHERE AlarmId IN (${dataAlarms.map(da => da.AlarmId).join(',')}, '-1') WHERE AlarmId IN (${dataAlarms.map(da => da.AlarmId).join(',')}, '-1')
AND AlarmState = 0 AND AlarmState = 0
`) `).toPromise()
} }
if (proDebug) { if (proDebug) {
console.log(`查得数据告警详情数据 ${dataAlarmDetails.length}`); console.log(`查得数据告警详情数据 ${dataAlarmDetails.length}`);

Loading…
Cancel
Save