refactor: move fetchCurrentConfigVersion() to settings loader
This commit is contained in:
parent
d3d4042d97
commit
bb440eedd6
4 changed files with 20 additions and 24 deletions
|
|
@ -11,6 +11,7 @@ const logger = require('./logger')
|
|||
const logs = require('./logs')
|
||||
const T = require('./time')
|
||||
const configManager = require('./new-config-manager')
|
||||
const settingsLoader = require('./new-settings-loader')
|
||||
const ticker = require('./ticker')
|
||||
const wallet = require('./wallet')
|
||||
const walletScoring = require('./wallet-scoring')
|
||||
|
|
@ -237,15 +238,6 @@ function plugins (settings, deviceId) {
|
|||
.then(([cassettes, recyclers]) => ({ cassettes: cassettes.cassettes, recyclers: recyclers.recyclers }))
|
||||
}
|
||||
|
||||
function fetchCurrentConfigVersion () {
|
||||
const sql = `SELECT id FROM user_config
|
||||
WHERE type = 'config'
|
||||
AND valid
|
||||
ORDER BY id DESC
|
||||
LIMIT 1`
|
||||
return db.one(sql).then(row => row.id)
|
||||
}
|
||||
|
||||
function mapCoinSettings (coinParams) {
|
||||
const [ cryptoCode, cryptoNetwork ] = coinParams
|
||||
const commissions = configManager.getCommissions(cryptoCode, deviceId, settings.config)
|
||||
|
|
@ -287,7 +279,7 @@ function plugins (settings, deviceId) {
|
|||
return Promise.all([
|
||||
buildAvailableCassettes(),
|
||||
buildAvailableRecyclers(),
|
||||
fetchCurrentConfigVersion(),
|
||||
settingsLoader.fetchCurrentConfigVersion(),
|
||||
millisecondsToMinutes(getTimezoneOffset(localeConfig.timezone)),
|
||||
loyalty.getNumberOfAvailablePromoCodes(),
|
||||
Promise.all(supportsBatchingPromise),
|
||||
|
|
@ -1030,7 +1022,6 @@ function plugins (settings, deviceId) {
|
|||
sell,
|
||||
getNotificationConfig,
|
||||
notifyOperator,
|
||||
fetchCurrentConfigVersion,
|
||||
pruneMachinesHeartbeat,
|
||||
rateAddress,
|
||||
isWalletScoringEnabled,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue