diff --git a/src/datalayer/persistance.js b/src/datalayer/persistance.js index 52da2fb4..9ece8832 100644 --- a/src/datalayer/persistance.js +++ b/src/datalayer/persistance.js @@ -113,15 +113,8 @@ const clearPendingRoots = async (storeId) => { }; const addMirror = async (storeId, url, forceAddMirror = false) => { - logger.info( - `ZGB: in persistance.js, forceAddMirror is ${forceAddMirror}, url is ${url}, storeId is ${storeId}`, - ); - await wallet.waitForAllTransactionsToConfirm(); const homeOrg = await Organization.getHomeOrg(); - logger.info( - `ZGB: homeorg is ${homeOrg}, forceAddMirror is ${forceAddMirror}, url is ${url}, storeId is ${storeId}`, - ); logger.info( `Checking mirrors for storeID is ${storeId} with mirror URL ${url}`, @@ -572,7 +565,7 @@ const subscribeToStoreOnDataLayer = async (storeId) => { const mirrorUrl = await getMirrorUrl(); - await addMirror(storeId, mirrorUrl); + await addMirror(storeId, mirrorUrl, true); return data; } diff --git a/src/datalayer/writeService.js b/src/datalayer/writeService.js index 9e1c42ea..bbe8d917 100644 --- a/src/datalayer/writeService.js +++ b/src/datalayer/writeService.js @@ -38,8 +38,8 @@ const createDataLayerStore = async () => { return storeId; }; -const addMirror = async (storeId, url) => { - return dataLayer.addMirror(storeId, url); +const addMirror = async (storeId, url, force = false) => { + return dataLayer.addMirror(storeId, url, force); }; const waitForStoreToBeConfirmed = async (storeId, retry = 0) => { diff --git a/src/models/organizations/organizations.model.js b/src/models/organizations/organizations.model.js index 90c5b4ff..b593967d 100644 --- a/src/models/organizations/organizations.model.js +++ b/src/models/organizations/organizations.model.js @@ -223,9 +223,6 @@ class Organization extends Model { } static async addMirror(storeId, url, force = false) { - logger.info( - `ZGB: in organizations.model.js, storeId is ${storeId}, force is ${force}, url is ${url}`, - ); await datalayer.addMirror(storeId, url, force); } diff --git a/src/tasks/mirror-check.js b/src/tasks/mirror-check.js index ad5be9ca..7ebb1965 100644 --- a/src/tasks/mirror-check.js +++ b/src/tasks/mirror-check.js @@ -19,12 +19,10 @@ const task = new Task('mirror-check', async () => { await assertDataLayerAvailable(); await assertWalletIsSynced(); - logger.info(`ZGB: In the loop to do the mirror-check - no logic run yet`); // Default AUTO_MIRROR_EXTERNAL_STORES to true if it is null or undefined const shouldMirror = CONFIG?.AUTO_MIRROR_EXTERNAL_STORES ?? true; if (!CONFIG.USE_SIMULATOR && shouldMirror) { - logger.info(`ZGB: Conditions met for mirror-check - trying now`); runMirrorCheck(); } } catch (error) { @@ -47,11 +45,9 @@ const job = new SimpleIntervalJob( const runMirrorCheck = async () => { const organizations = await Organization.getOrgsMap(); const orgs = Object.keys(organizations); - logger.info(`ZGB: orgs available: ${orgs}`); for (const org of orgs) { const orgData = organizations[org]; const mirrorUrl = await getMirrorUrl(); - logger.info(`ZGB: Working on mirror for ${org} with URL ${mirrorUrl}`); if (mirrorUrl) { // There is logic within the addMirror function to check if the mirror already exists await Organization.addMirror(orgData.orgUid, mirrorUrl, true);