Make modules/context.Context a context.Context (#16031)

* Make modules/context.Context a context.Context

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Simplify context calls

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Set the base context for requests to the HammerContext

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
zeripath 2021-05-31 07:18:11 +01:00 committed by GitHub
parent 518ed504ef
commit 3183a465d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 46 additions and 23 deletions

View file

@ -35,7 +35,7 @@ func FlushQueues(ctx *context.PrivateContext) {
})
return
}
err := queue.GetManager().FlushAll(ctx.Req.Context(), opts.Timeout)
err := queue.GetManager().FlushAll(ctx, opts.Timeout)
if err != nil {
ctx.JSON(http.StatusRequestTimeout, map[string]interface{}{
"err": fmt.Sprintf("%v", err),