forked from TrueCloudLab/frostfs-node
[#1437] blobovnicza: Fix contextcheck linter
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
6db46257c0
commit
62b5181618
22 changed files with 82 additions and 81 deletions
|
@ -269,7 +269,7 @@ loop:
|
|||
continue loop
|
||||
}
|
||||
|
||||
l.handleNotifyEvent(notifyEvent)
|
||||
l.handleNotifyEvent(ctx, notifyEvent)
|
||||
case notaryEvent, ok := <-chs.NotaryRequestsCh:
|
||||
if !ok {
|
||||
l.log.Warn(ctx, logs.EventStopEventListenerByNotaryChannel)
|
||||
|
@ -316,16 +316,16 @@ func (l *listener) handleNotaryEvent(notaryEvent *result.NotaryRequestEvent) {
|
|||
}
|
||||
}
|
||||
|
||||
func (l *listener) handleNotifyEvent(notifyEvent *state.ContainedNotificationEvent) {
|
||||
func (l *listener) handleNotifyEvent(ctx context.Context, notifyEvent *state.ContainedNotificationEvent) {
|
||||
if err := l.pool.Submit(func() {
|
||||
l.parseAndHandleNotification(notifyEvent)
|
||||
l.parseAndHandleNotification(ctx, notifyEvent)
|
||||
}); err != nil {
|
||||
l.log.Warn(context.Background(), logs.EventListenerWorkerPoolDrained,
|
||||
l.log.Warn(ctx, logs.EventListenerWorkerPoolDrained,
|
||||
zap.Int("capacity", l.pool.Cap()))
|
||||
}
|
||||
}
|
||||
|
||||
func (l *listener) parseAndHandleNotification(notifyEvent *state.ContainedNotificationEvent) {
|
||||
func (l *listener) parseAndHandleNotification(ctx context.Context, notifyEvent *state.ContainedNotificationEvent) {
|
||||
log := l.log.With(
|
||||
zap.String("script hash LE", notifyEvent.ScriptHash.StringLE()),
|
||||
)
|
||||
|
@ -347,7 +347,7 @@ func (l *listener) parseAndHandleNotification(notifyEvent *state.ContainedNotifi
|
|||
l.mtx.RUnlock()
|
||||
|
||||
if !ok {
|
||||
log.Debug(context.Background(), logs.EventEventParserNotSet)
|
||||
log.Debug(ctx, logs.EventEventParserNotSet)
|
||||
|
||||
return
|
||||
}
|
||||
|
@ -355,7 +355,7 @@ func (l *listener) parseAndHandleNotification(notifyEvent *state.ContainedNotifi
|
|||
// parse the notification event
|
||||
event, err := parser(notifyEvent)
|
||||
if err != nil {
|
||||
log.Warn(context.Background(), logs.EventCouldNotParseNotificationEvent,
|
||||
log.Warn(ctx, logs.EventCouldNotParseNotificationEvent,
|
||||
zap.String("error", err.Error()),
|
||||
)
|
||||
|
||||
|
@ -368,7 +368,7 @@ func (l *listener) parseAndHandleNotification(notifyEvent *state.ContainedNotifi
|
|||
l.mtx.RUnlock()
|
||||
|
||||
if len(handlers) == 0 {
|
||||
log.Info(context.Background(), logs.EventNotificationHandlersForParsedNotificationEventWereNotRegistered,
|
||||
log.Info(ctx, logs.EventNotificationHandlersForParsedNotificationEventWereNotRegistered,
|
||||
zap.Any("event", event),
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue