fix: [CDE-416]: Increasing timeout to 10m for all gitspace events. (#2861)

* fix: [CDE-416]: Increasing timeout to 10m for all gitspace events.
pull/3576/head
Dhruv Dhruv 2024-10-24 12:49:36 +00:00 committed by Harness
parent 8c5e7546c3
commit 3668c43a2a
4 changed files with 7 additions and 4 deletions

View File

@ -32,6 +32,7 @@ type Config struct {
EventReaderName string
Concurrency int
MaxRetries int
TimeoutInMins int
}
func (c *Config) Sanitize() error {
@ -71,7 +72,7 @@ func NewService(
_, err := gitspaceEventReaderFactory.Launch(ctx, groupGitspaceEvents, config.EventReaderName,
func(r *gitspaceevents.Reader) error {
const idleTimeout = 1 * time.Minute
var idleTimeout = time.Duration(config.TimeoutInMins) * time.Minute
r.Configure(
stream.WithConcurrency(config.Concurrency),
stream.WithHandlerOptions(

View File

@ -57,7 +57,7 @@ func NewService(
_, err := gitspaceInfraEventReaderFactory.Launch(ctx, groupGitspaceInfraEvents, config.EventReaderName,
func(r *gitspaceinfraevents.Reader) error {
const idleTimeout = 1 * time.Minute
var idleTimeout = time.Duration(config.TimeoutInMins) * time.Minute
r.Configure(
stream.WithConcurrency(config.Concurrency),
stream.WithHandlerOptions(

View File

@ -463,5 +463,6 @@ func ProvideGitspaceEventConfig(config *types.Config) *gitspaceevent.Config {
EventReaderName: config.InstanceID,
Concurrency: config.Gitspace.Events.Concurrency,
MaxRetries: config.Gitspace.Events.MaxRetries,
TimeoutInMins: config.Gitspace.Events.TimeoutInMins,
}
}

View File

@ -424,8 +424,9 @@ type Config struct {
AgentPort int `envconfig:"GITNESS_GITSPACE_AGENT_PORT" default:"8083"`
Events struct {
Concurrency int `envconfig:"GITNESS_GITSPACE_EVENTS_CONCURRENCY" default:"4"`
MaxRetries int `envconfig:"GITNESS_GITSPACE_EVENTS_MAX_RETRIES" default:"3"`
Concurrency int `envconfig:"GITNESS_GITSPACE_EVENTS_CONCURRENCY" default:"4"`
MaxRetries int `envconfig:"GITNESS_GITSPACE_EVENTS_MAX_RETRIES" default:"3"`
TimeoutInMins int `envconfig:"GITNESS_GITSPACE_EVENTS_TIMEOUT_IN_MINS" default:"10"`
}
}