Browse Source

优化推送逻辑

release_1.1.2
巴林闲侠 3 years ago
parent
commit
4dcd501d98
  1. 6
      code/VideoAccess-VCMP/api/app/lib/schedule/cameraStatePush.js

6
code/VideoAccess-VCMP/api/app/lib/schedule/cameraStatePush.js

@ -35,6 +35,7 @@ module.exports = function (app, opts) {
const timeNow = moment().startOf('minute').format()
for (let c of configRes) {
console.log('上下线推送方式', c.pushWay,);
// 查配置信息所对应的摄像头15min内的在离线状态
const cameraIds = c.cameraStatusPushMonitors.map(m => m.cameraId)
const offlineStatusRes = await models.CameraStatusOfflineLog.findAll({
@ -51,7 +52,7 @@ module.exports = function (app, opts) {
}],
order: [['time', 'ASC']],
})
console.log('上下线推送路线记录', offlineStatusRes);
if (offlineStatusRes.length) {
const cameraStatusMap = {}
// 当前逻辑
@ -120,7 +121,8 @@ module.exports = function (app, opts) {
// camera: cameraIds,
}
// 离线推送
console.log('离线推送', c.pushWay, offArr, onArr, receiver,);
console.log('上下线推送数据', offArr, onArr);
console.log('上下线推送接收', receiver);
if (offArr.length && c.noticeWay && c.noticeWay.includes('offline') && receiver.length) {
if (c.pushWay == 'email') {
// 邮件

Loading…
Cancel
Save