only update sanctionsdb if enabled
This commit is contained in:
parent
0e3c0961ea
commit
6a8dfe90cf
2 changed files with 18 additions and 5 deletions
18
lib/app.js
18
lib/app.js
|
|
@ -7,6 +7,7 @@ const routes = require('./routes')
|
|||
const logger = require('./logger')
|
||||
const poller = require('./poller')
|
||||
const settingsLoader = require('./settings-loader')
|
||||
const configManager = require('./config-manager')
|
||||
const options = require('./options')
|
||||
const ofac = require('./ofac/index')
|
||||
const ofacUpdate = require('./ofac/update')
|
||||
|
|
@ -36,11 +37,18 @@ function run () {
|
|||
}
|
||||
|
||||
function loadSanctions () {
|
||||
logger.info('Loading sanctions DB...')
|
||||
return ofacUpdate.update()
|
||||
.then(() => logger.info('Sanctions DB updated'))
|
||||
.then(ofac.load)
|
||||
.then(() => logger.info('Sanctions DB loaded'))
|
||||
return settingsLoader.loadLatest()
|
||||
.then(settings => {
|
||||
const config = configManager.unscoped(settings.config)
|
||||
|
||||
if (!config.sanctionsVerificationActive) return
|
||||
|
||||
logger.info('Loading sanctions DB...')
|
||||
return ofacUpdate.update()
|
||||
.then(() => logger.info('Sanctions DB updated'))
|
||||
.then(ofac.load)
|
||||
.then(() => logger.info('Sanctions DB loaded'))
|
||||
})
|
||||
}
|
||||
|
||||
function runOnce () {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue