mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-25 09:48:32 +02:00
refactor(routes): replace route retrieval with GetIncludeExcluded
- Updated route retrieval in the API and idle watcher to use GetIncludeExcluded, allowing for the inclusion of excluded routes. - Simplified the route status aggregation logic by directly using GetIncludeExcluded for display name resolution. - Removed redundant code that separately handled excluded routes, streamlining the route management process.
This commit is contained in:
@@ -130,17 +130,10 @@ func (rs RouteStatuses) aggregate(limit int, offset int) Aggregated {
|
||||
up, down, idle, latency := rs.calculateInfo(statuses)
|
||||
|
||||
displayName := alias
|
||||
r, ok := routes.Get(alias)
|
||||
if !ok {
|
||||
// also search for excluded routes
|
||||
r, ok = routes.Excluded.Get(alias)
|
||||
}
|
||||
if r != nil {
|
||||
displayName = r.DisplayName()
|
||||
}
|
||||
|
||||
status := types.StatusUnknown
|
||||
if r != nil {
|
||||
r, ok := routes.GetIncludeExcluded(alias)
|
||||
if ok {
|
||||
displayName = r.DisplayName()
|
||||
mon := r.HealthMonitor()
|
||||
if mon != nil {
|
||||
status = mon.Status()
|
||||
|
||||
Reference in New Issue
Block a user