forked from TrueCloudLab/frostfs-node
[#1437] node: Fix contextcheck linter
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
6921a89061
commit
7429553266
209 changed files with 1068 additions and 1036 deletions
|
@ -9,9 +9,9 @@ import (
|
|||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
func (np *Processor) processNetmapCleanupTick(ev netmapCleanupTick) bool {
|
||||
if !np.alphabetState.IsAlphabet() {
|
||||
np.log.Info(context.Background(), logs.NetmapNonAlphabetModeIgnoreNewNetmapCleanupTick)
|
||||
func (np *Processor) processNetmapCleanupTick(ctx context.Context, ev netmapCleanupTick) bool {
|
||||
if !np.alphabetState.IsAlphabet(ctx) {
|
||||
np.log.Info(ctx, logs.NetmapNonAlphabetModeIgnoreNewNetmapCleanupTick)
|
||||
|
||||
return true
|
||||
}
|
||||
|
@ -19,13 +19,13 @@ func (np *Processor) processNetmapCleanupTick(ev netmapCleanupTick) bool {
|
|||
err := np.netmapSnapshot.forEachRemoveCandidate(ev.epoch, func(s string) error {
|
||||
key, err := keys.NewPublicKeyFromString(s)
|
||||
if err != nil {
|
||||
np.log.Warn(context.Background(), logs.NetmapCantDecodePublicKeyOfNetmapNode,
|
||||
np.log.Warn(ctx, logs.NetmapCantDecodePublicKeyOfNetmapNode,
|
||||
zap.String("key", s))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
np.log.Info(context.Background(), logs.NetmapVoteToRemoveNodeFromNetmap, zap.String("key", s))
|
||||
np.log.Info(ctx, logs.NetmapVoteToRemoveNodeFromNetmap, zap.String("key", s))
|
||||
|
||||
// In notary environments we call UpdateStateIR method instead of UpdateState.
|
||||
// It differs from UpdateState only by name, so we can do this in the same form.
|
||||
|
@ -33,6 +33,7 @@ func (np *Processor) processNetmapCleanupTick(ev netmapCleanupTick) bool {
|
|||
const methodUpdateStateNotary = "updateStateIR"
|
||||
|
||||
err = np.netmapClient.MorphNotaryInvoke(
|
||||
ctx,
|
||||
np.netmapClient.ContractAddress(),
|
||||
0,
|
||||
uint32(ev.epoch),
|
||||
|
@ -41,13 +42,13 @@ func (np *Processor) processNetmapCleanupTick(ev netmapCleanupTick) bool {
|
|||
int64(v2netmap.Offline), key.Bytes(),
|
||||
)
|
||||
if err != nil {
|
||||
np.log.Error(context.Background(), logs.NetmapCantInvokeNetmapUpdateState, zap.Error(err))
|
||||
np.log.Error(ctx, logs.NetmapCantInvokeNetmapUpdateState, zap.Error(err))
|
||||
}
|
||||
|
||||
return nil
|
||||
})
|
||||
if err != nil {
|
||||
np.log.Warn(context.Background(), logs.NetmapCantIterateOnNetmapCleanerCache,
|
||||
np.log.Warn(ctx, logs.NetmapCantIterateOnNetmapCleanerCache,
|
||||
zap.String("error", err.Error()))
|
||||
return false
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue