diff --git a/src/services/setup.js b/src/services/setup.js index 4f8ed7ce3..6a558db4b 100644 --- a/src/services/setup.js +++ b/src/services/setup.js @@ -4,6 +4,7 @@ const log = require('./log'); const sqlInit = require('./sql_init'); const repository = require('./repository'); const optionService = require('./options'); +const syncOptions = require('./sync_options'); async function isSyncServerInitialized() { const response = await requestToSyncServer('GET', '/api/setup/status'); @@ -36,11 +37,8 @@ async function setupSyncToSyncServer() { } async function requestToSyncServer(method, path, body = null) { - const syncServerHost = await optionService.getOption('syncServerHost'); - const syncProxy = await optionService.getOption('syncProxy'); - const rpOpts = { - uri: syncServerHost + path, + uri: await syncOptions.getSyncServerHost() + path, method: method, json: true }; @@ -49,6 +47,8 @@ async function requestToSyncServer(method, path, body = null) { rpOpts.body = body; } + const syncProxy = await syncOptions.getSyncProxy(); + if (syncProxy) { rpOpts.proxy = syncProxy; }