Reduce log ingest and SCUM page refresh pressure
This commit is contained in:
@@ -1619,12 +1619,22 @@ func (svc *CoreService) GetRunEndpoint(id string) (domain.RunEndpoint, error) {
|
||||
}
|
||||
|
||||
func (svc *CoreService) ListRunEndpoints(filter domain.RunEndpointFilter) ([]domain.RunEndpoint, error) {
|
||||
svc.controlMu.Lock()
|
||||
defer svc.controlMu.Unlock()
|
||||
if err := svc.sweepExpiredRunRegistrationsLocked(svc.now()); err != nil {
|
||||
endpoints, err := svc.store.RunEndpoints().List(domain.RunEndpointFilter{})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return svc.store.RunEndpoints().List(filter)
|
||||
stamp := svc.now()
|
||||
items := make([]domain.RunEndpoint, 0, len(endpoints))
|
||||
for _, endpoint := range endpoints {
|
||||
if !runEndpointRegistrationCurrentAt(endpoint, stamp) && (endpoint.Status == domain.RunEndpointStatusOnline || endpoint.Status == domain.RunEndpointStatusDegraded) {
|
||||
endpoint.Status = domain.RunEndpointStatusOffline
|
||||
}
|
||||
if filter.Status != "" && endpoint.Status != filter.Status {
|
||||
continue
|
||||
}
|
||||
items = append(items, domain.CopyRunEndpoint(endpoint))
|
||||
}
|
||||
return items, nil
|
||||
}
|
||||
|
||||
func (svc *CoreService) CreateServerInstance(instance domain.ServerInstance) (domain.ServerInstance, error) {
|
||||
|
||||
Reference in New Issue
Block a user