mirror of
https://github.com/go-gitea/gitea
synced 2025-07-22 18:28:37 +00:00
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:
@@ -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
|
||||
|
Reference in New Issue
Block a user