diff --git a/docker-compose.yml b/docker-compose.yml index ed2e589b..6f1e86dd 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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: diff --git a/sample.env b/sample.env index 06c694a2..99bfa1f7 100644 --- a/sample.env +++ b/sample.env @@ -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= diff --git a/services/gatekeeper/server/src/config.js b/services/gatekeeper/server/src/config.js index 320c64fc..8517d0d4 100644 --- a/services/gatekeeper/server/src/config.js +++ b/services/gatekeeper/server/src/config.js @@ -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; diff --git a/services/gatekeeper/server/src/gatekeeper-api.js b/services/gatekeeper/server/src/gatekeeper-api.js index f57da561..247b62f4 100644 --- a/services/gatekeeper/server/src/gatekeeper-api.js +++ b/services/gatekeeper/server/src/gatekeeper-api.js @@ -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);