[#193] getsvc: Resolve context linters

Resolve containedctx and contextcheck linters.

Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2023-03-31 14:49:40 +03:00 committed by Gitea
parent 206458c841
commit 1bf21dbb47
9 changed files with 39 additions and 48 deletions

View file

@ -7,7 +7,7 @@ import (
"go.uber.org/zap"
)
func (exec *execCtx) executeOnContainer() {
func (exec *execCtx) executeOnContainer(ctx context.Context) {
if exec.isLocal() {
exec.log.Debug("return result directly")
return
@ -26,7 +26,7 @@ func (exec *execCtx) executeOnContainer() {
}
for {
if exec.processCurrentEpoch() {
if exec.processCurrentEpoch(ctx) {
break
}
@ -42,7 +42,7 @@ func (exec *execCtx) executeOnContainer() {
}
}
func (exec *execCtx) processCurrentEpoch() bool {
func (exec *execCtx) processCurrentEpoch(ctx context.Context) bool {
exec.log.Debug("process epoch",
zap.Uint64("number", exec.curProcEpoch),
)
@ -52,7 +52,7 @@ func (exec *execCtx) processCurrentEpoch() bool {
return true
}
ctx, cancel := context.WithCancel(exec.context())
ctx, cancel := context.WithCancel(ctx)
defer cancel()
exec.status = statusUndefined