mirror of https://github.com/harness/drone.git
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
parent
8c5e7546c3
commit
3668c43a2a
|
@ -32,6 +32,7 @@ type Config struct {
|
||||||
EventReaderName string
|
EventReaderName string
|
||||||
Concurrency int
|
Concurrency int
|
||||||
MaxRetries int
|
MaxRetries int
|
||||||
|
TimeoutInMins int
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *Config) Sanitize() error {
|
func (c *Config) Sanitize() error {
|
||||||
|
@ -71,7 +72,7 @@ func NewService(
|
||||||
|
|
||||||
_, err := gitspaceEventReaderFactory.Launch(ctx, groupGitspaceEvents, config.EventReaderName,
|
_, err := gitspaceEventReaderFactory.Launch(ctx, groupGitspaceEvents, config.EventReaderName,
|
||||||
func(r *gitspaceevents.Reader) error {
|
func(r *gitspaceevents.Reader) error {
|
||||||
const idleTimeout = 1 * time.Minute
|
var idleTimeout = time.Duration(config.TimeoutInMins) * time.Minute
|
||||||
r.Configure(
|
r.Configure(
|
||||||
stream.WithConcurrency(config.Concurrency),
|
stream.WithConcurrency(config.Concurrency),
|
||||||
stream.WithHandlerOptions(
|
stream.WithHandlerOptions(
|
||||||
|
|
|
@ -57,7 +57,7 @@ func NewService(
|
||||||
|
|
||||||
_, err := gitspaceInfraEventReaderFactory.Launch(ctx, groupGitspaceInfraEvents, config.EventReaderName,
|
_, err := gitspaceInfraEventReaderFactory.Launch(ctx, groupGitspaceInfraEvents, config.EventReaderName,
|
||||||
func(r *gitspaceinfraevents.Reader) error {
|
func(r *gitspaceinfraevents.Reader) error {
|
||||||
const idleTimeout = 1 * time.Minute
|
var idleTimeout = time.Duration(config.TimeoutInMins) * time.Minute
|
||||||
r.Configure(
|
r.Configure(
|
||||||
stream.WithConcurrency(config.Concurrency),
|
stream.WithConcurrency(config.Concurrency),
|
||||||
stream.WithHandlerOptions(
|
stream.WithHandlerOptions(
|
||||||
|
|
|
@ -463,5 +463,6 @@ func ProvideGitspaceEventConfig(config *types.Config) *gitspaceevent.Config {
|
||||||
EventReaderName: config.InstanceID,
|
EventReaderName: config.InstanceID,
|
||||||
Concurrency: config.Gitspace.Events.Concurrency,
|
Concurrency: config.Gitspace.Events.Concurrency,
|
||||||
MaxRetries: config.Gitspace.Events.MaxRetries,
|
MaxRetries: config.Gitspace.Events.MaxRetries,
|
||||||
|
TimeoutInMins: config.Gitspace.Events.TimeoutInMins,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -424,8 +424,9 @@ type Config struct {
|
||||||
AgentPort int `envconfig:"GITNESS_GITSPACE_AGENT_PORT" default:"8083"`
|
AgentPort int `envconfig:"GITNESS_GITSPACE_AGENT_PORT" default:"8083"`
|
||||||
|
|
||||||
Events struct {
|
Events struct {
|
||||||
Concurrency int `envconfig:"GITNESS_GITSPACE_EVENTS_CONCURRENCY" default:"4"`
|
Concurrency int `envconfig:"GITNESS_GITSPACE_EVENTS_CONCURRENCY" default:"4"`
|
||||||
MaxRetries int `envconfig:"GITNESS_GITSPACE_EVENTS_MAX_RETRIES" default:"3"`
|
MaxRetries int `envconfig:"GITNESS_GITSPACE_EVENTS_MAX_RETRIES" default:"3"`
|
||||||
|
TimeoutInMins int `envconfig:"GITNESS_GITSPACE_EVENTS_TIMEOUT_IN_MINS" default:"10"`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue