mirror of
https://github.com/yusing/godoxy.git
synced 2025-06-06 11:42:34 +02:00
tweak(route): start routes in parallel
This commit is contained in:
parent
bdb3343a7c
commit
3135e377a9
2 changed files with 8 additions and 3 deletions
|
@ -69,6 +69,8 @@ type (
|
|||
impl routes.Route
|
||||
isValidated bool
|
||||
lastError gperr.Error
|
||||
|
||||
started chan struct{}
|
||||
}
|
||||
Routes map[string]*Route
|
||||
)
|
||||
|
@ -218,6 +220,7 @@ func (r *Route) Validate() gperr.Error {
|
|||
|
||||
r.impl = impl
|
||||
r.Excluded = r.ShouldExclude()
|
||||
r.started = make(chan struct{})
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -244,8 +247,10 @@ func (r *Route) Finish(reason any) {
|
|||
r.impl = nil
|
||||
}
|
||||
|
||||
func (r *Route) Started() bool {
|
||||
return r.impl != nil
|
||||
func (r *Route) Started() <-chan struct{} {
|
||||
return r.started
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func (r *Route) ProviderName() string {
|
||||
|
|
|
@ -27,7 +27,7 @@ type (
|
|||
HealthMonitor() health.HealthMonitor
|
||||
References() []string
|
||||
|
||||
Started() bool
|
||||
Started() <-chan struct{}
|
||||
|
||||
IdlewatcherConfig() *idlewatcher.Config
|
||||
HealthCheckConfig() *health.HealthCheckConfig
|
||||
|
|
Loading…
Add table
Reference in a new issue