Skip to content

Commit

Permalink
Merge pull request #5 from johnnybravo-xyz/master
Browse files Browse the repository at this point in the history
Fix bug in no-group-job response
  • Loading branch information
knadh authored Feb 25, 2020
2 parents b346da0 + a2de1af commit 7bdeaed
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 7bdeaed

Please sign in to comment.