forked from TrueCloudLab/frostfs-node
[#1437] ir: Fix contextcheck linters
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
16598553d9
commit
6921a89061
27 changed files with 165 additions and 157 deletions
|
@ -13,11 +13,11 @@ import (
|
|||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
func (np *Processor) handleDeposit(ev event.Event) {
|
||||
func (np *Processor) handleDeposit(ctx context.Context, ev event.Event) {
|
||||
deposit := ev.(frostfsEvent.Deposit)
|
||||
depositIDBin := bytes.Clone(deposit.ID())
|
||||
slices.Reverse(depositIDBin)
|
||||
np.log.Info(context.Background(), logs.Notification,
|
||||
np.log.Info(ctx, logs.Notification,
|
||||
zap.String("type", "deposit"),
|
||||
zap.String("id", hex.EncodeToString(depositIDBin)))
|
||||
|
||||
|
@ -28,16 +28,16 @@ func (np *Processor) handleDeposit(ev event.Event) {
|
|||
})
|
||||
if err != nil {
|
||||
// there system can be moved into controlled degradation stage
|
||||
np.log.Warn(context.Background(), logs.FrostFSFrostfsProcessorWorkerPoolDrained,
|
||||
np.log.Warn(ctx, logs.FrostFSFrostfsProcessorWorkerPoolDrained,
|
||||
zap.Int("capacity", np.pool.Cap()))
|
||||
}
|
||||
}
|
||||
|
||||
func (np *Processor) handleWithdraw(ev event.Event) {
|
||||
func (np *Processor) handleWithdraw(ctx context.Context, ev event.Event) {
|
||||
withdraw := ev.(frostfsEvent.Withdraw)
|
||||
withdrawBin := bytes.Clone(withdraw.ID())
|
||||
slices.Reverse(withdrawBin)
|
||||
np.log.Info(context.Background(), logs.Notification,
|
||||
np.log.Info(ctx, logs.Notification,
|
||||
zap.String("type", "withdraw"),
|
||||
zap.String("id", hex.EncodeToString(withdrawBin)))
|
||||
|
||||
|
@ -48,14 +48,14 @@ func (np *Processor) handleWithdraw(ev event.Event) {
|
|||
})
|
||||
if err != nil {
|
||||
// there system can be moved into controlled degradation stage
|
||||
np.log.Warn(context.Background(), logs.FrostFSFrostfsProcessorWorkerPoolDrained,
|
||||
np.log.Warn(ctx, logs.FrostFSFrostfsProcessorWorkerPoolDrained,
|
||||
zap.Int("capacity", np.pool.Cap()))
|
||||
}
|
||||
}
|
||||
|
||||
func (np *Processor) handleCheque(ev event.Event) {
|
||||
func (np *Processor) handleCheque(ctx context.Context, ev event.Event) {
|
||||
cheque := ev.(frostfsEvent.Cheque)
|
||||
np.log.Info(context.Background(), logs.Notification,
|
||||
np.log.Info(ctx, logs.Notification,
|
||||
zap.String("type", "cheque"),
|
||||
zap.String("id", hex.EncodeToString(cheque.ID())))
|
||||
|
||||
|
@ -66,14 +66,14 @@ func (np *Processor) handleCheque(ev event.Event) {
|
|||
})
|
||||
if err != nil {
|
||||
// there system can be moved into controlled degradation stage
|
||||
np.log.Warn(context.Background(), logs.FrostFSFrostfsProcessorWorkerPoolDrained,
|
||||
np.log.Warn(ctx, logs.FrostFSFrostfsProcessorWorkerPoolDrained,
|
||||
zap.Int("capacity", np.pool.Cap()))
|
||||
}
|
||||
}
|
||||
|
||||
func (np *Processor) handleConfig(ev event.Event) {
|
||||
func (np *Processor) handleConfig(ctx context.Context, ev event.Event) {
|
||||
cfg := ev.(frostfsEvent.Config)
|
||||
np.log.Info(context.Background(), logs.Notification,
|
||||
np.log.Info(ctx, logs.Notification,
|
||||
zap.String("type", "set config"),
|
||||
zap.String("key", hex.EncodeToString(cfg.Key())),
|
||||
zap.String("value", hex.EncodeToString(cfg.Value())))
|
||||
|
@ -85,7 +85,7 @@ func (np *Processor) handleConfig(ev event.Event) {
|
|||
})
|
||||
if err != nil {
|
||||
// there system can be moved into controlled degradation stage
|
||||
np.log.Warn(context.Background(), logs.FrostFSFrostfsProcessorWorkerPoolDrained,
|
||||
np.log.Warn(ctx, logs.FrostFSFrostfsProcessorWorkerPoolDrained,
|
||||
zap.Int("capacity", np.pool.Cap()))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue