fix: add status field to service list/detail APIs, unify observeStats retry pattern, fix router bugs
- api: add fillServiceStatus helper and call it from getServiceList/getService so status field appears in service list and detail API responses - observeStats: unify retry pattern across all 9 handlers (http, http2, masque, relay, router, socks4, socks5, tungo, tunnel) — buffer events on failure, continue to skip fresh collection, clear on success; fix event-loss bug where interim events were dropped during retry cycles - handler/router: check WriteTo/Write return errors in associate.go and entrypoint.go; fix DelConnector and ConnectorPool.Del using RLock instead of Lock (write under read lock); remove unused fields t and cancel
This commit is contained in:
@@ -43,6 +43,13 @@ func getServiceList(ctx *gin.Context) {
|
||||
|
||||
list := config.Global().Services
|
||||
|
||||
for _, svc := range list {
|
||||
if svc == nil {
|
||||
continue
|
||||
}
|
||||
fillServiceStatus(svc)
|
||||
}
|
||||
|
||||
var resp getServiceListResponse
|
||||
resp.Data = serviceList{
|
||||
Count: len(list),
|
||||
@@ -89,6 +96,7 @@ func getService(ctx *gin.Context) {
|
||||
continue
|
||||
}
|
||||
if service.Name == req.Service {
|
||||
fillServiceStatus(service)
|
||||
resp.Data = service
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user