diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e9056e..57d9281 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +### [0.0.1-alpha.104](https://github.com/DIG-Network/dig-propagation-server/compare/v0.0.1-alpha.103...v0.0.1-alpha.104) (2024-10-05) + ### [0.0.1-alpha.103](https://github.com/DIG-Network/dig-propagation-server/compare/v0.0.1-alpha.102...v0.0.1-alpha.103) (2024-10-05) ### [0.0.1-alpha.102](https://github.com/DIG-Network/dig-propagation-server/compare/v0.0.1-alpha.101...v0.0.1-alpha.102) (2024-10-05) diff --git a/package-lock.json b/package-lock.json index 1682711..cfa863d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "dig-propagation-server", - "version": "0.0.1-alpha.103", + "version": "0.0.1-alpha.104", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "dig-propagation-server", - "version": "0.0.1-alpha.103", + "version": "0.0.1-alpha.104", "license": "ISC", "dependencies": { "@dignetwork/datalayer-driver": "^0.1.28", diff --git a/package.json b/package.json index 51dd577..d6048a1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dig-propagation-server", - "version": "0.0.1-alpha.103", + "version": "0.0.1-alpha.104", "description": "", "type": "commonjs", "main": "./dist/index.js", diff --git a/src/controllers/storeController.ts b/src/controllers/storeController.ts index 27b7e65..c82371d 100644 --- a/src/controllers/storeController.ts +++ b/src/controllers/storeController.ts @@ -112,9 +112,10 @@ export const syncStoreFromRequestor = async ( return; } - const allStores = await DataStore.getAllStores(); + const allStores = DataStore.getAllStores(); + const allStoreIds = allStores.map((store) => store.StoreId); - if (!allStores.includes(storeId)) { + if (!allStoreIds.includes(storeId)) { res.status(400).json({ error: `Store ${storeId} does not exist.`, }); diff --git a/src/tasks/sync_stores.ts b/src/tasks/sync_stores.ts index a794a7d..eb56bc6 100644 --- a/src/tasks/sync_stores.ts +++ b/src/tasks/sync_stores.ts @@ -32,7 +32,7 @@ const checkedPeersMap: Map> = new Map(); const processPeer = async (peerIp: string, storeId: string, rootHash: string, checkedPeers: Set): Promise => { try { const digPeer = new DigPeer(peerIp, storeId); - const hasRootHash = await withTimeout(digPeer.contentServer.hasRootHash(rootHash), 5000, "`Dig Peer: ${peerIp} took to long to respond to head request`"); + const hasRootHash = await withTimeout(digPeer.contentServer.hasRootHash(rootHash), 5000, `Dig Peer: ${peerIp} took to long to respond to head request`); if (hasRootHash) { console.log(`Dig Peer ${peerIp} already has rootHash ${rootHash}. Marking as checked.`);