Skip to content

Commit

Permalink
Fix bug in no-group-job response
Browse files Browse the repository at this point in the history
  • Loading branch information
riteshshrv committed Feb 25, 2020
1 parent b346da0 commit a2de1af
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion http.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down

0 comments on commit a2de1af

Please sign in to comment.