2019-05-08 16:12:02 +03:00
|
|
|
const fs = require('fs')
|
|
|
|
const path = require('path')
|
|
|
|
const logger = require('./logger')('checkWorker3')
|
|
|
|
const stuckTransfers = require('./stuckTransfers')
|
|
|
|
|
|
|
|
async function checkWorker3() {
|
|
|
|
try {
|
|
|
|
logger.debug('calling stuckTransfers()')
|
|
|
|
const transfers = await stuckTransfers()
|
|
|
|
// console.log(transfers)
|
|
|
|
if (!transfers) throw new Error('transfers is empty: ' + JSON.stringify(transfers))
|
2019-08-01 16:10:22 +03:00
|
|
|
fs.writeFileSync(path.join(__dirname, '/responses/stuckTransfers.json'), JSON.stringify(transfers, null, 4))
|
2019-05-08 16:12:02 +03:00
|
|
|
logger.debug('Done')
|
|
|
|
} catch (e) {
|
|
|
|
logger.error('checkWorker3.js', e)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
checkWorker3()
|