|
|
@ -4,9 +4,10 @@ module.exports = function (app, opts) { |
|
|
|
const cameraOnlinePush = app.fs.scheduleInit( |
|
|
|
{ |
|
|
|
interval: '* */15 * * * *', |
|
|
|
interval: '*/15 * * * * *', |
|
|
|
// interval: '* */1 * * * *',
|
|
|
|
// interval: '* */5 * * * *',
|
|
|
|
immediate: false, |
|
|
|
proRun: true, |
|
|
|
// proRun: true,
|
|
|
|
}, |
|
|
|
async () => { |
|
|
|
try { |
|
|
@ -119,11 +120,12 @@ module.exports = function (app, opts) { |
|
|
|
// camera: cameraIds,
|
|
|
|
} |
|
|
|
// 离线推送
|
|
|
|
console.log('object'); |
|
|
|
if (offArr.length && c.noticeWay && c.noticeWay.includes('offline')) { |
|
|
|
if (c.pushWay == 'email') { |
|
|
|
// 邮件
|
|
|
|
let text = `【${corUser[0].username}】账号下的设备,截止【${moment(timeNow).format('MM月DD日 HH时mm分')}】,有${offArr.length}个设备掉线:\n` |
|
|
|
text += offArr.map(o => `【${o.name}】于【${o.time}】掉线,`).join('\n') |
|
|
|
text += offArr.map(o => `【${o.name}】于【${moment(o.time).format('MM月DD日 HH时mm分')}】掉线,`).join('\n') |
|
|
|
text += `\n请及时处理!` |
|
|
|
await pushByEmail({ |
|
|
|
email: receiver, |
|
|
|