Bump nim codex and fix configuration

This commit is contained in:
Arnaud 2025-11-14 05:01:45 +01:00
parent 1cf7fe4407
commit 017b032d84
No known key found for this signature in database
GPG Key ID: 20E40A5D3110766F
4 changed files with 45 additions and 3 deletions

View File

@ -159,12 +159,12 @@ type Config struct {
// Default block timeout in seconds - 0 disables the ttl
// Default: 30 days
BlockTtl int `json:"block-ttl,omitempty"`
BlockTtl string `json:"block-ttl,omitempty"`
// Time interval in seconds - determines frequency of block
// maintenance cycle: how often blocks are checked for expiration and cleanup
// Default: 10 minutes
BlockMaintenanceInterval int `json:"block-mi,omitempty"`
BlockMaintenanceInterval string `json:"block-mi,omitempty"`
// Number of blocks to check every maintenance cycle
// Default: 1000

View File

@ -121,3 +121,33 @@ func TestCreateAndDestroyMultipleInstancesWithSameDatadir(t *testing.T) {
}
}
}
func TestNumThreads(t *testing.T) {
node := newCodexNode(t, Config{
NumThreads: 1,
})
if node == nil {
t.Fatal("expected codex node to be created")
}
}
func TestBlockTtl(t *testing.T) {
node := newCodexNode(t, Config{
BlockTtl: "10H",
})
if node == nil {
t.Fatal("expected codex node to be created")
}
}
func TestBlockMaintenanceInterval(t *testing.T) {
node := newCodexNode(t, Config{
BlockMaintenanceInterval: "10H",
})
if node == nil {
t.Fatal("expected codex node to be created")
}
}

View File

@ -47,6 +47,18 @@ func newCodexNode(t *testing.T, opts ...Config) *CodexNode {
if c.StorageQuota != 0 {
config.StorageQuota = c.StorageQuota
}
if c.NumThreads != 0 {
config.NumThreads = c.NumThreads
}
if c.BlockTtl != "" {
config.BlockTtl = c.BlockTtl
}
if c.BlockMaintenanceInterval != "" {
config.BlockMaintenanceInterval = c.BlockMaintenanceInterval
}
}
node, err := New(config)

2
vendor/nim-codex vendored

@ -1 +1 @@
Subproject commit c80d44ff93057dd41e8ea3d55bef572eb503dfd2
Subproject commit 2b9fc1eb554e5eee43b8a815084fb8c61687ada9