From 9ed3f53dfb7ea3957e2bae5265e4d89fa34bc2e8 Mon Sep 17 00:00:00 2001 From: Liran Cohen Date: Tue, 27 Aug 2024 18:57:48 -0400 Subject: [PATCH] update max ttl to 21 days --- packages/agent/src/store-data.ts | 7 ++++--- packages/user-agent/src/user-agent.ts | 11 ++--------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/packages/agent/src/store-data.ts b/packages/agent/src/store-data.ts index f6f1a3ace..7d5699022 100644 --- a/packages/agent/src/store-data.ts +++ b/packages/agent/src/store-data.ts @@ -57,9 +57,10 @@ export class DwnDataStore = Jwk> implem * Index for mappings from Store Identifier to DWN record ID. * Since these values don't change, we can use a long TTL. * - * Up to 1,000 entries are retained for 30 days. + * Up to 1,000 entries are retained for 21 days. + * NOTE: The maximum number for the ttl is 2^31 - 1 milliseconds (24.8 days), setting to 21 days to be safe. */ - protected _index = new TtlCache({ ttl: ms('30 days'), max: 1000 }); + protected _index = new TtlCache({ ttl: ms('21 days'), max: 1000 }); /** * Cache of tenant DIDs that have been initialized with the protocol. @@ -67,7 +68,7 @@ export class DwnDataStore = Jwk> implem * * Since these are default protocols and unlikely to change, we can use a long TTL. */ - protected _protocolInitializedCache: TtlCache = new TtlCache({ ttl: ms('30 days'), max: 1000 }); + protected _protocolInitializedCache: TtlCache = new TtlCache({ ttl: ms('21 days'), max: 1000 }); /** * The protocol assigned to this storage instance. diff --git a/packages/user-agent/src/user-agent.ts b/packages/user-agent/src/user-agent.ts index 76c85fcca..9568959fb 100644 --- a/packages/user-agent/src/user-agent.ts +++ b/packages/user-agent/src/user-agent.ts @@ -151,11 +151,9 @@ export class Web5UserAgent {