From a2de1af3774e8934186f2b48c298249ea5fd544b Mon Sep 17 00:00:00 2001 From: Ritesh Shrivastav Date: Tue, 25 Feb 2020 15:05:23 +0530 Subject: [PATCH] Fix bug in no-group-job response --- http.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/http.go b/http.go index 6e49a08..432b1ac 100644 --- a/http.go +++ b/http.go @@ -57,12 +57,16 @@ func handleGetGroupStatus(w http.ResponseWriter, r *http.Request) { groupID = chi.URLParam(r, "groupID") ) + if _, err := jobber.Machinery.GetBackend().GetState(groupID); err == redis.ErrNil { + sendErrorResponse(w, "group not found", http.StatusNotFound) + return + } + res, err := jobber.Machinery.GetBackend().GroupTaskStates(groupID, 0) if err != nil { sysLog.Printf("error fetching group status: %v", err) sendErrorResponse(w, "error fetching group status", http.StatusInternalServerError) return - } var (