fix sync check - it was always reporting success even in failure cases

This commit is contained in:
zadam 2020-11-15 20:50:24 +01:00
parent 47d61c416d
commit b5480b4137

View File

@ -13,13 +13,13 @@ const dateUtils = require('../../services/date_utils');
const entityConstructor = require('../../entities/entity_constructor'); const entityConstructor = require('../../entities/entity_constructor');
const utils = require('../../services/utils'); const utils = require('../../services/utils');
function testSync() { async function testSync() {
try { try {
if (!syncOptions.isSyncSetup()) { if (!syncOptions.isSyncSetup()) {
return { success: false, message: "Sync server host is not configured. Please configure sync first." }; return { success: false, message: "Sync server host is not configured. Please configure sync first." };
} }
syncService.login(); await syncService.login();
// login was successful so we'll kick off sync now // login was successful so we'll kick off sync now
// this is important in case when sync server has been just initialized // this is important in case when sync server has been just initialized