@@ -4,7 +4,6 @@ const Web3Util = require('./helpers/web3')
4
4
const q = require ( './queues' )
5
5
const db = require ( './models' )
6
6
const events = require ( 'events' )
7
- // const config = require('config')
8
7
const logger = require ( './helpers/logger' )
9
8
10
9
// fix warning max listener
@@ -26,8 +25,6 @@ let countJobs = () => {
26
25
27
26
const watch = async ( ) => {
28
27
try {
29
- // let isSend = false
30
- // let isOver2Minutes = 0
31
28
let step = 100
32
29
let setting = await db . Setting . findOne ( { meta_key : 'min_block_crawl' } )
33
30
let newJobSetting = await db . Setting . findOne ( { meta_key : 'push_new_job' } )
@@ -79,34 +76,9 @@ const watch = async () => {
79
76
80
77
if ( minBlockCrawl > parseInt ( setting . meta_value ) ) {
81
78
setting . meta_value = minBlockCrawl
82
- // isOver2Minutes = 0
83
- // isSend = true
84
79
await setting . save ( )
85
80
newJobSetting = await db . Setting . findOne ( { meta_key : 'push_new_job' } )
86
81
}
87
-
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
- // }
110
82
}
111
83
}
112
84
} catch ( e ) {
0 commit comments