From 544968a4de5ebfa1c462bac86aaa7974b4c4a435 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Duffeck?= Date: Thu, 30 Apr 2026 11:00:12 +0200 Subject: [PATCH] Set new defaults for caches and stores See https://github.com/opencloud-eu/opencloud/issues/2681 for more details. --- pkg/roles/manager.go | 2 +- services/eventhistory/pkg/config/defaults/defaultconfig.go | 4 +--- services/graph/pkg/config/defaults/defaultconfig.go | 2 +- services/ocs/pkg/config/defaults/defaultconfig.go | 2 +- services/postprocessing/pkg/config/defaults/defaultconfig.go | 1 + services/storage-system/pkg/config/defaults/defaultconfig.go | 2 +- services/storage-users/pkg/config/defaults/defaultconfig.go | 2 +- 7 files changed, 7 insertions(+), 8 deletions(-) diff --git a/pkg/roles/manager.go b/pkg/roles/manager.go index eb85d23bbc..c191262ea2 100644 --- a/pkg/roles/manager.go +++ b/pkg/roles/manager.go @@ -15,7 +15,7 @@ import ( const ( cacheDatabase = "opencloud-pkg" cacheTableName = "roles" - cacheTTL = time.Hour + cacheTTL = 24 * time.Hour ) // Manager manages a cache of roles by fetching unknown roles from the settings.RoleService. diff --git a/services/eventhistory/pkg/config/defaults/defaultconfig.go b/services/eventhistory/pkg/config/defaults/defaultconfig.go index ee085414d8..d61f57934d 100644 --- a/services/eventhistory/pkg/config/defaults/defaultconfig.go +++ b/services/eventhistory/pkg/config/defaults/defaultconfig.go @@ -1,8 +1,6 @@ package defaults import ( - "time" - "github.com/opencloud-eu/opencloud/pkg/structs" "github.com/opencloud-eu/opencloud/services/eventhistory/pkg/config" ) @@ -37,7 +35,7 @@ func DefaultConfig() *config.Config { Nodes: []string{"127.0.0.1:9233"}, Database: "eventhistory", Table: "", - TTL: 336 * time.Hour, + TTL: 0, }, GRPC: config.GRPCConfig{ Addr: "127.0.0.1:9274", diff --git a/services/graph/pkg/config/defaults/defaultconfig.go b/services/graph/pkg/config/defaults/defaultconfig.go index 9b5352f6ea..8f18e58a75 100644 --- a/services/graph/pkg/config/defaults/defaultconfig.go +++ b/services/graph/pkg/config/defaults/defaultconfig.go @@ -114,7 +114,7 @@ func DefaultConfig() *config.Config { Store: "memory", Nodes: []string{"127.0.0.1:9233"}, Database: "cache-roles", - TTL: time.Hour * 336, + TTL: time.Hour * 24, }, Events: config.Events{ Endpoint: "127.0.0.1:9233", diff --git a/services/ocs/pkg/config/defaults/defaultconfig.go b/services/ocs/pkg/config/defaults/defaultconfig.go index 59872940c8..e39f83a31c 100644 --- a/services/ocs/pkg/config/defaults/defaultconfig.go +++ b/services/ocs/pkg/config/defaults/defaultconfig.go @@ -42,7 +42,7 @@ func DefaultConfig() *config.Config { SigningKeys: &config.SigningKeys{ Store: "nats-js-kv", // signing keys are read by proxy, so we cannot use memory. It is not shared. Nodes: []string{"127.0.0.1:9233"}, - TTL: time.Hour * 12, + TTL: time.Hour * 24, }, } } diff --git a/services/postprocessing/pkg/config/defaults/defaultconfig.go b/services/postprocessing/pkg/config/defaults/defaultconfig.go index 39186aaa1f..2e2e45f60f 100644 --- a/services/postprocessing/pkg/config/defaults/defaultconfig.go +++ b/services/postprocessing/pkg/config/defaults/defaultconfig.go @@ -42,6 +42,7 @@ func DefaultConfig() *config.Config { Nodes: []string{"127.0.0.1:9233"}, Database: "postprocessing", Table: "", + TTL: 7 * 24 * time.Hour, }, } } diff --git a/services/storage-system/pkg/config/defaults/defaultconfig.go b/services/storage-system/pkg/config/defaults/defaultconfig.go index 9608cd4662..4fdcb568e6 100644 --- a/services/storage-system/pkg/config/defaults/defaultconfig.go +++ b/services/storage-system/pkg/config/defaults/defaultconfig.go @@ -54,7 +54,7 @@ func DefaultConfig() *config.Config { Store: "memory", Nodes: []string{"127.0.0.1:9233"}, Database: "storage-system", - TTL: 24 * 60 * time.Second, + TTL: 24 * 60 * 60 * time.Second, }, } } diff --git a/services/storage-users/pkg/config/defaults/defaultconfig.go b/services/storage-users/pkg/config/defaults/defaultconfig.go index 541d56d20a..5e777f60fc 100644 --- a/services/storage-users/pkg/config/defaults/defaultconfig.go +++ b/services/storage-users/pkg/config/defaults/defaultconfig.go @@ -165,7 +165,7 @@ func DefaultConfig() *config.Config { Store: "memory", Nodes: []string{"127.0.0.1:9233"}, Database: "storage-users", - TTL: 24 * 60 * time.Second, + TTL: 24 * 60 * 60 * time.Second, }, IDCache: config.IDCache{ Store: "nats-js-kv",