Skip to content

Commit

Permalink
Renamed checkDb to checkDIDs
Browse files Browse the repository at this point in the history
  • Loading branch information
macterra committed Dec 17, 2024
1 parent adc7bea commit a58496c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/gatekeeper/src/gatekeeper-lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions services/gatekeeper/server/src/gatekeeper-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`);
Expand Down
6 changes: 3 additions & 3 deletions tests/gatekeeper.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2608,7 +2608,7 @@ describe('verifyDb', () => {
});
});

describe('checkDb', () => {
describe('checkDIDs', () => {
afterEach(() => {
mockFs.restore();
});
Expand All @@ -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);
});
Expand All @@ -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);
});
Expand Down

0 comments on commit a58496c

Please sign in to comment.