mirror of
https://github.com/fnproject/fn.git
synced 2022-10-28 21:29:17 +03:00
Reject async requests in case if MQ is not reachable
This commit is contained in:
committed by
Reed Allman
parent
565f61fe6f
commit
97b0b97bd8
@@ -245,8 +245,14 @@ func (s *Server) serve(ctx context.Context, c *gin.Context, appName string, rout
|
||||
priority := int32(0)
|
||||
newTask.Priority = &priority
|
||||
newTask.Payload = string(pl)
|
||||
|
||||
// Push to queue
|
||||
enqueue(c, s.MQ, newTask)
|
||||
_, err = enqueue(c, s.MQ, newTask)
|
||||
if err != nil {
|
||||
handleErrorResponse(c, err)
|
||||
return true
|
||||
}
|
||||
|
||||
log.Info("Added new task to queue")
|
||||
c.JSON(http.StatusAccepted, map[string]string{"call_id": newTask.ID})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user