Merge pull request #2702 from aduffeck/fix-nats-ttl
Set new defaults for caches and stores
This commit is contained in:
@@ -15,7 +15,7 @@ import (
|
|||||||
const (
|
const (
|
||||||
cacheDatabase = "opencloud-pkg"
|
cacheDatabase = "opencloud-pkg"
|
||||||
cacheTableName = "roles"
|
cacheTableName = "roles"
|
||||||
cacheTTL = time.Hour
|
cacheTTL = 24 * time.Hour
|
||||||
)
|
)
|
||||||
|
|
||||||
// Manager manages a cache of roles by fetching unknown roles from the settings.RoleService.
|
// Manager manages a cache of roles by fetching unknown roles from the settings.RoleService.
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
package defaults
|
package defaults
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/opencloud-eu/opencloud/pkg/structs"
|
"github.com/opencloud-eu/opencloud/pkg/structs"
|
||||||
"github.com/opencloud-eu/opencloud/services/eventhistory/pkg/config"
|
"github.com/opencloud-eu/opencloud/services/eventhistory/pkg/config"
|
||||||
)
|
)
|
||||||
@@ -37,7 +35,7 @@ func DefaultConfig() *config.Config {
|
|||||||
Nodes: []string{"127.0.0.1:9233"},
|
Nodes: []string{"127.0.0.1:9233"},
|
||||||
Database: "eventhistory",
|
Database: "eventhistory",
|
||||||
Table: "",
|
Table: "",
|
||||||
TTL: 336 * time.Hour,
|
TTL: 0,
|
||||||
},
|
},
|
||||||
GRPC: config.GRPCConfig{
|
GRPC: config.GRPCConfig{
|
||||||
Addr: "127.0.0.1:9274",
|
Addr: "127.0.0.1:9274",
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ func DefaultConfig() *config.Config {
|
|||||||
Store: "memory",
|
Store: "memory",
|
||||||
Nodes: []string{"127.0.0.1:9233"},
|
Nodes: []string{"127.0.0.1:9233"},
|
||||||
Database: "cache-roles",
|
Database: "cache-roles",
|
||||||
TTL: time.Hour * 336,
|
TTL: time.Hour * 24,
|
||||||
},
|
},
|
||||||
Events: config.Events{
|
Events: config.Events{
|
||||||
Endpoint: "127.0.0.1:9233",
|
Endpoint: "127.0.0.1:9233",
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ func DefaultConfig() *config.Config {
|
|||||||
SigningKeys: &config.SigningKeys{
|
SigningKeys: &config.SigningKeys{
|
||||||
Store: "nats-js-kv", // signing keys are read by proxy, so we cannot use memory. It is not shared.
|
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"},
|
Nodes: []string{"127.0.0.1:9233"},
|
||||||
TTL: time.Hour * 12,
|
TTL: time.Hour * 24,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ func DefaultConfig() *config.Config {
|
|||||||
Nodes: []string{"127.0.0.1:9233"},
|
Nodes: []string{"127.0.0.1:9233"},
|
||||||
Database: "postprocessing",
|
Database: "postprocessing",
|
||||||
Table: "",
|
Table: "",
|
||||||
|
TTL: 7 * 24 * time.Hour,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ func DefaultConfig() *config.Config {
|
|||||||
Store: "memory",
|
Store: "memory",
|
||||||
Nodes: []string{"127.0.0.1:9233"},
|
Nodes: []string{"127.0.0.1:9233"},
|
||||||
Database: "storage-system",
|
Database: "storage-system",
|
||||||
TTL: 24 * 60 * time.Second,
|
TTL: 24 * time.Hour,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ func DefaultConfig() *config.Config {
|
|||||||
Store: "memory",
|
Store: "memory",
|
||||||
Nodes: []string{"127.0.0.1:9233"},
|
Nodes: []string{"127.0.0.1:9233"},
|
||||||
Database: "storage-users",
|
Database: "storage-users",
|
||||||
TTL: 24 * 60 * time.Second,
|
TTL: 24 * time.Hour,
|
||||||
},
|
},
|
||||||
IDCache: config.IDCache{
|
IDCache: config.IDCache{
|
||||||
Store: "nats-js-kv",
|
Store: "nats-js-kv",
|
||||||
|
|||||||
Reference in New Issue
Block a user