summaryrefslogtreecommitdiff
path: root/plugins/http/plugin.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/http/plugin.go')
-rw-r--r--plugins/http/plugin.go20
1 files changed, 19 insertions, 1 deletions
diff --git a/plugins/http/plugin.go b/plugins/http/plugin.go
index 82cf76ed..13a76329 100644
--- a/plugins/http/plugin.go
+++ b/plugins/http/plugin.go
@@ -405,7 +405,25 @@ func (s *Plugin) Status() status.Status {
}
// if there are no workers, threat this as error
return status.Status{
- Code: http.StatusInternalServerError,
+ Code: http.StatusNoContent,
+ }
+}
+
+// Status return status of the particular plugin
+func (s *Plugin) Ready() status.Status {
+ workers := s.Workers()
+ for i := 0; i < len(workers); i++ {
+ // If state of the worker is ready (at least 1)
+ // we assume, that plugin's worker pool is ready
+ if workers[i].State().Value() == worker.StateReady {
+ return status.Status{
+ Code: http.StatusOK,
+ }
+ }
+ }
+ // if there are no workers, threat this as no content error
+ return status.Status{
+ Code: http.StatusNoContent,
}
}