Make the write buffer duration configurable

This commit is contained in:
André Duffeck
2025-05-16 10:24:43 +02:00
parent b3017dc774
commit c618c7436a
6 changed files with 29 additions and 12 deletions
@@ -32,6 +32,8 @@ type Config struct {
ServiceAccount ServiceAccount `yaml:"service_account"`
Context context.Context `yaml:"-"`
WriteBufferDuration time.Duration `yaml:"write_buffer_duration" env:"ACTIVITYLOG_WRITE_BUFFER_DURATION" desc:"The duration to wait before flushing the write buffer. This is used to reduce the number of writes to the store." introductionVersion:"%%NEXT%%"`
}
// Events combines the configuration options for the event bus.
@@ -1,6 +1,8 @@
package defaults
import (
"time"
"github.com/opencloud-eu/opencloud/pkg/shared"
"github.com/opencloud-eu/opencloud/pkg/structs"
"github.com/opencloud-eu/opencloud/services/activitylog/pkg/config"
@@ -50,6 +52,7 @@ func DefaultConfig() *config.Config {
AllowCredentials: true,
},
},
WriteBufferDuration: 10 * time.Second,
}
}