fix: use more specific function
`loadLatest()` returns a `Promise`, therefore accessing the `config` property is not correct.
This commit is contained in:
parent
437a1d3505
commit
5342e9a8be
1 changed files with 1 additions and 5 deletions
|
|
@ -11,7 +11,6 @@ const pairing = require('./pairing')
|
||||||
const { checkPings, checkStuckScreen } = require('./notifier')
|
const { checkPings, checkStuckScreen } = require('./notifier')
|
||||||
const dbm = require('./postgresql_interface')
|
const dbm = require('./postgresql_interface')
|
||||||
const configManager = require('./new-config-manager')
|
const configManager = require('./new-config-manager')
|
||||||
const settingsLoader = require('./new-settings-loader')
|
|
||||||
const notifierUtils = require('./notifier/utils')
|
const notifierUtils = require('./notifier/utils')
|
||||||
const notifierQueries = require('./notifier/queries')
|
const notifierQueries = require('./notifier/queries')
|
||||||
const { ApolloError } = require('apollo-server-errors');
|
const { ApolloError } = require('apollo-server-errors');
|
||||||
|
|
@ -94,9 +93,7 @@ function getUnpairedMachines () {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getConfig (defaultConfig) {
|
function getConfig (defaultConfig) {
|
||||||
if (defaultConfig) return Promise.resolve(defaultConfig)
|
return defaultConfig ? Promise.resolve(defaultConfig) : loadLatestConfig()
|
||||||
|
|
||||||
return settingsLoader.loadLatest().config
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const getStatus = (ping, stuck) => {
|
const getStatus = (ping, stuck) => {
|
||||||
|
|
@ -529,7 +526,6 @@ module.exports = {
|
||||||
updateNetworkHeartbeat,
|
updateNetworkHeartbeat,
|
||||||
getNetworkPerformance,
|
getNetworkPerformance,
|
||||||
getNetworkHeartbeat,
|
getNetworkHeartbeat,
|
||||||
getConfig,
|
|
||||||
getMachineIds,
|
getMachineIds,
|
||||||
emptyMachineUnits,
|
emptyMachineUnits,
|
||||||
refillMachineUnits,
|
refillMachineUnits,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue