mirror of
https://github.com/yusing/godoxy.git
synced 2026-01-11 22:30:47 +01:00
tweak(route): start routes in parallel
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user