async calls return the call_id/task_id

This commit is contained in:
Seif Lotfy
2016-10-01 04:04:51 +02:00
parent d8801d5be7
commit a8535120da
3 changed files with 39 additions and 7 deletions

View File

@@ -86,6 +86,7 @@ func (s *Server) UseSpecialHandlers(ginC *gin.Context) error {
func (s *Server) handleRunnerRequest(c *gin.Context) {
enqueue := func(task *models.Task) (*models.Task, error) {
c.JSON(http.StatusAccepted, map[string]string{"call_id": task.ID})
return s.MQ.Push(task)
}
handleRequest(c, enqueue)