Manager: actually return worker state in /api/worker/state endpoint
This commit is contained in:
parent
d6df00db3e
commit
93517549b0
@ -160,10 +160,17 @@ func (f *Flamenco) SignOff(e echo.Context) error {
|
|||||||
|
|
||||||
// (GET /api/worker/state)
|
// (GET /api/worker/state)
|
||||||
func (f *Flamenco) WorkerState(e echo.Context) error {
|
func (f *Flamenco) WorkerState(e echo.Context) error {
|
||||||
// TODO: look up proper status in DB.
|
worker := requestWorkerOrPanic(e)
|
||||||
|
|
||||||
|
if worker.StatusRequested == "" {
|
||||||
return e.String(http.StatusNoContent, "")
|
return e.String(http.StatusNoContent, "")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return e.JSON(http.StatusOK, api.WorkerStateChange{
|
||||||
|
StatusRequested: worker.StatusRequested,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// Worker changed state. This could be as acknowledgement of a Manager-requested state change, or in response to worker-local signals.
|
// Worker changed state. This could be as acknowledgement of a Manager-requested state change, or in response to worker-local signals.
|
||||||
// (POST /api/worker/state-changed)
|
// (POST /api/worker/state-changed)
|
||||||
func (f *Flamenco) WorkerStateChanged(e echo.Context) error {
|
func (f *Flamenco) WorkerStateChanged(e echo.Context) error {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user