Skip to content

Commit 23e48b6

Browse files
committed
remove notify to slack
1 parent 3aa2b5b commit 23e48b6

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

server/src/producer.js

+22-22
Original file line numberDiff line numberDiff line change
@@ -85,28 +85,28 @@ const watch = async () => {
8585
newJobSetting = await db.Setting.findOne({ meta_key: 'push_new_job' })
8686
}
8787

88-
if (String(maxBlockNum) === String(minBlockCrawl)) {
89-
isOver2Minutes += 0.5 // Similar to 0.5 second
90-
91-
// send notification after 2 minutes
92-
if (isOver2Minutes >= 240 && isSend) {
93-
let slack = require('slack-notify')(config.get('SLACK_WEBHOOK_URL'))
94-
logger.info('Slack Notification - There is no new block in last 2 minutes')
95-
await slack.send({
96-
attachments: [
97-
{
98-
author_name: 'Slack Bot',
99-
title: ':warning: WARNING',
100-
color: 'danger',
101-
text: '<!channel> There is no new block in last 2 minutes'
102-
}
103-
]
104-
})
105-
isSend = false
106-
}
107-
logger.debug('Sleep 0.5 seconds')
108-
await sleep(500)
109-
}
88+
// if (String(maxBlockNum) === String(minBlockCrawl)) {
89+
// isOver2Minutes += 0.5 // Similar to 0.5 second
90+
//
91+
// // send notification after 2 minutes
92+
// if (isOver2Minutes >= 240 && isSend) {
93+
// let slack = require('slack-notify')(config.get('SLACK_WEBHOOK_URL'))
94+
// logger.info('Slack Notification - There is no new block in last 2 minutes')
95+
// await slack.send({
96+
// attachments: [
97+
// {
98+
// author_name: 'Slack Bot',
99+
// title: ':warning: WARNING',
100+
// color: 'danger',
101+
// text: '<!channel> There is no new block in last 2 minutes'
102+
// }
103+
// ]
104+
// })
105+
// isSend = false
106+
// }
107+
// logger.debug('Sleep 0.5 seconds')
108+
// await sleep(500)
109+
// }
110110
}
111111
}
112112
} catch (e) {

0 commit comments

Comments
 (0)