Skip to content

Commit

Permalink
Added KC_GATEKEEPER_STATUS_INTERVAL
Browse files Browse the repository at this point in the history
  • Loading branch information
macterra committed Dec 20, 2024
1 parent db35216 commit 56863c6
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ services:
- KC_GATEKEEPER_DB=${KC_GATEKEEPER_DB}
- KC_GATEKEEPER_REGISTRIES=${KC_GATEKEEPER_REGISTRIES}
- KC_GATEKEEPER_GC_INTERVAL=${KC_GATEKEEPER_GC_INTERVAL}
- KC_GATEKEEPER_STATUS_INTERVAL=${KC_GATEKEEPER_STATUS_INTERVAL}
- KC_MONGODB_URL=mongodb://mongodb:27017
- KC_REDIS_URL=redis://redis:6379
volumes:
Expand Down
1 change: 1 addition & 0 deletions sample.env
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ KC_GATEKEEPER_DB=json-cache
KC_GATEKEEPER_REGISTRIES=hyperswarm,TBTC,TFTC
KC_GATEKEEPER_PORT=4224
KC_GATEKEEPER_GC_INTERVAL=60
KC_GATEKEEPER_STATUS_INTERVAL=5

# Keymaster
KC_ENCRYPTED_PASSPHRASE=
Expand Down
1 change: 1 addition & 0 deletions services/gatekeeper/server/src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const config = {
db: process.env.KC_GATEKEEPER_DB || 'redis',
registries: process.env.KC_GATEKEEPER_REGISTRIES,
gcInterval: process.env.KC_GATEKEEPER_GC_INTERVAL ? parseInt(process.env.KC_GATEKEEPER_GC_INTERVAL) : 15,
statusInterval: process.env.KC_GATEKEEPER_STATUS_INTERVAL ? parseInt(process.env.KC_GATEKEEPER_STATUS_INTERVAL) : 5,
};

export default config;
4 changes: 2 additions & 2 deletions services/gatekeeper/server/src/gatekeeper-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,9 +384,9 @@ function formatBytes(bytes) {
}

async function main() {
console.log(`Starting Gatekeeper with a db (${config.db}) check...`);
console.log(`Starting KeychainMDIP Gatekeeper with a db (${config.db}) check...`);
await reportStatus();
setInterval(reportStatus, 60 * 1000);
setInterval(reportStatus, config.statusInterval * 60 * 1000);

console.log(`Starting DID garbage collection in ${config.gcInterval} minutes`);
setTimeout(gcLoop, config.gcInterval * 60 * 1000);
Expand Down

0 comments on commit 56863c6

Please sign in to comment.