Merge in release and fix conflicts
This commit is contained in:
commit
e7ef9d0753
7 changed files with 56 additions and 9 deletions
|
|
@ -1,3 +1,5 @@
|
|||
const _ = require('lodash/fp')
|
||||
|
||||
const plugins = require('./plugins')
|
||||
const notifier = require('./notifier')
|
||||
const T = require('./time')
|
||||
|
|
@ -16,6 +18,7 @@ const SWEEP_HD_INTERVAL = T.minute
|
|||
const TRADE_INTERVAL = 60 * T.seconds
|
||||
const PONG_INTERVAL = 10 * T.seconds
|
||||
const PONG_CLEAR_INTERVAL = 1 * T.day
|
||||
const SANCTIONS_INITIAL_DOWNLOAD_INTERVAL = 5 * T.minutes
|
||||
const SANCTIONS_UPDATE_INTERVAL = 1 * T.week
|
||||
const RADAR_UPDATE_INTERVAL = 5 * T.minutes
|
||||
|
||||
|
|
@ -35,6 +38,15 @@ function reload (__settings) {
|
|||
function pi () { return _pi }
|
||||
function settings () { return _settings }
|
||||
|
||||
function initialSanctionsDownload () {
|
||||
const structs = sanctions.getStructs()
|
||||
const isEmptyStructs = _.isNil(structs) || _.flow(_.values, _.all(_.isEmpty))(structs)
|
||||
|
||||
if (!isEmptyStructs) return Promise.resolve()
|
||||
|
||||
return updateAndLoadSanctions()
|
||||
}
|
||||
|
||||
function updateAndLoadSanctions () {
|
||||
const config = configManager.unscoped(settings().config)
|
||||
|
||||
|
|
@ -75,6 +87,7 @@ function start (__settings) {
|
|||
setInterval(() => pi().pong(), PONG_INTERVAL)
|
||||
setInterval(() => pi().pongClear(), PONG_CLEAR_INTERVAL)
|
||||
setInterval(() => notifier.checkNotification(pi()), CHECK_NOTIFICATION_INTERVAL)
|
||||
setInterval(initialSanctionsDownload, SANCTIONS_INITIAL_DOWNLOAD_INTERVAL)
|
||||
setInterval(updateAndLoadSanctions, SANCTIONS_UPDATE_INTERVAL)
|
||||
setInterval(updateCoinAtmRadar, RADAR_UPDATE_INTERVAL)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue