Reduce server console polling load
This commit is contained in:
@@ -544,7 +544,22 @@ func matchRunEndpoint(endpoint domain.RunEndpoint, filter domain.RunEndpointFilt
|
||||
func matchJob(job domain.Job, filter domain.JobFilter) bool {
|
||||
return (filter.ServerInstanceID == "" || job.ServerInstanceID == filter.ServerInstanceID) &&
|
||||
(filter.RunEndpointID == "" || job.RunEndpointID == filter.RunEndpointID) &&
|
||||
(filter.State == "" || job.State == filter.State)
|
||||
matchJobState(job.State, filter)
|
||||
}
|
||||
|
||||
func matchJobState(state domain.JobState, filter domain.JobFilter) bool {
|
||||
if filter.State != "" && state != filter.State {
|
||||
return false
|
||||
}
|
||||
if len(filter.States) == 0 {
|
||||
return true
|
||||
}
|
||||
for _, candidate := range filter.States {
|
||||
if state == candidate {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func matchArtifact(artifact domain.Artifact, filter domain.ArtifactFilter) bool {
|
||||
|
||||
Reference in New Issue
Block a user