[#193] getsvc: Resolve context linters
Resolve containedctx and contextcheck linters. Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
206458c841
commit
1bf21dbb47
9 changed files with 39 additions and 48 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue