From a58496cc561298e84e03f4314a4d1b979d5e56b8 Mon Sep 17 00:00:00 2001 From: David McFadzean Date: Tue, 17 Dec 2024 17:27:20 -0500 Subject: [PATCH] Renamed checkDb to checkDIDs --- packages/gatekeeper/src/gatekeeper-lib.js | 2 +- services/gatekeeper/server/src/gatekeeper-api.js | 6 +++--- tests/gatekeeper.test.js | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/gatekeeper/src/gatekeeper-lib.js b/packages/gatekeeper/src/gatekeeper-lib.js index 2dff0e96..13e081c8 100644 --- a/packages/gatekeeper/src/gatekeeper-lib.js +++ b/packages/gatekeeper/src/gatekeeper-lib.js @@ -116,7 +116,7 @@ export async function verifyDb(options = {}) { return { total, verified, expired, invalid }; } -export async function checkDb(options = {}) { +export async function checkDIDs(options = {}) { const { chatty = false } = options; const dids = await getDIDs(); const total = dids.length; diff --git a/services/gatekeeper/server/src/gatekeeper-api.js b/services/gatekeeper/server/src/gatekeeper-api.js index 00b647aa..da092894 100644 --- a/services/gatekeeper/server/src/gatekeeper-api.js +++ b/services/gatekeeper/server/src/gatekeeper-api.js @@ -271,9 +271,9 @@ async function gcLoop() { let didCheck; async function main() { - console.time('checkDb'); - didCheck = await gatekeeper.checkDb({ chatty: true }); - console.timeEnd('checkDb'); + console.time('checkDIDs'); + didCheck = await gatekeeper.checkDIDs({ chatty: true }); + console.timeEnd('checkDIDs'); console.log(`check: ${JSON.stringify(didCheck)}`); console.log(`Starting DID garbage collection in ${config.gcInterval} minutes`); diff --git a/tests/gatekeeper.test.js b/tests/gatekeeper.test.js index b3ceef40..ee3da413 100644 --- a/tests/gatekeeper.test.js +++ b/tests/gatekeeper.test.js @@ -2608,7 +2608,7 @@ describe('verifyDb', () => { }); }); -describe('checkDb', () => { +describe('checkDIDs', () => { afterEach(() => { mockFs.restore(); }); @@ -2622,7 +2622,7 @@ describe('checkDb', () => { const assetOp = await createAssetOp(agentDID, keypair); await gatekeeper.createDID(assetOp); - const { total } = await gatekeeper.checkDb(); + const { total } = await gatekeeper.checkDIDs(); expect(total).toBe(2); }); @@ -2638,7 +2638,7 @@ describe('checkDb', () => { fs.writeFileSync('data/test.json', "{ dids: {"); - const { total } = await gatekeeper.checkDb(); + const { total } = await gatekeeper.checkDIDs(); expect(total).toBe(0); });