diff options
author | zeripath <art27@cantab.net> | 2021-05-31 07:18:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-31 02:18:11 -0400 |
commit | 3183a465d71a13535e52589bb85b987176872fcd (patch) | |
tree | 03d1cb88627176f35e168cda5e46df197dcc3110 /services | |
parent | 518ed504ef8714eeac126fc59ff57f50a98e3692 (diff) | |
download | gitea-3183a465d71a13535e52589bb85b987176872fcd.tar.gz gitea-3183a465d71a13535e52589bb85b987176872fcd.zip |
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>
Diffstat (limited to 'services')
-rw-r--r-- | services/archiver/archiver.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/services/archiver/archiver.go b/services/archiver/archiver.go index 359fc8b627..dfa6334d95 100644 --- a/services/archiver/archiver.go +++ b/services/archiver/archiver.go @@ -76,7 +76,7 @@ func (aReq *ArchiveRequest) IsComplete() bool { func (aReq *ArchiveRequest) WaitForCompletion(ctx *context.Context) bool { select { case <-aReq.cchan: - case <-ctx.Req.Context().Done(): + case <-ctx.Done(): } return aReq.IsComplete() @@ -92,7 +92,7 @@ func (aReq *ArchiveRequest) TimedWaitForCompletion(ctx *context.Context, dur tim case <-time.After(dur): timeout = true case <-aReq.cchan: - case <-ctx.Req.Context().Done(): + case <-ctx.Done(): } return aReq.IsComplete(), timeout |