Remove run node UI and expire registrations
This commit is contained in:
@@ -25,7 +25,7 @@ var (
|
||||
|
||||
const (
|
||||
ServerDeletionForceConfirmation = "FORCE DELETE"
|
||||
runHeartbeatStaleAfter = 2 * time.Minute
|
||||
runHeartbeatStaleAfter = 30 * time.Second
|
||||
)
|
||||
|
||||
type ForbiddenError struct {
|
||||
@@ -1609,10 +1609,20 @@ func (svc *CoreService) CreateRunEndpoint(endpoint domain.RunEndpoint) (domain.R
|
||||
}
|
||||
|
||||
func (svc *CoreService) GetRunEndpoint(id string) (domain.RunEndpoint, error) {
|
||||
svc.controlMu.Lock()
|
||||
defer svc.controlMu.Unlock()
|
||||
if err := svc.sweepExpiredRunRegistrationsLocked(svc.now()); err != nil {
|
||||
return domain.RunEndpoint{}, err
|
||||
}
|
||||
return svc.store.RunEndpoints().Get(id)
|
||||
}
|
||||
|
||||
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 {
|
||||
return nil, err
|
||||
}
|
||||
return svc.store.RunEndpoints().List(filter)
|
||||
}
|
||||
|
||||
@@ -2645,10 +2655,7 @@ func (svc *CoreService) validateRunnableEndpoint(endpoint domain.RunEndpoint, ca
|
||||
}
|
||||
|
||||
func (svc *CoreService) runEndpointHeartbeatCurrent(endpoint domain.RunEndpoint) bool {
|
||||
if endpoint.LastHeartbeatAt.IsZero() {
|
||||
return false
|
||||
}
|
||||
return !svc.now().After(endpoint.LastHeartbeatAt.Add(runHeartbeatStaleAfter))
|
||||
return runEndpointRegistrationCurrentAt(endpoint, svc.now())
|
||||
}
|
||||
|
||||
func maxInt(a, b int) int {
|
||||
|
||||
Reference in New Issue
Block a user