@@ -364,7 +364,6 @@ func (c *connection) commandStartedEvent(ctx context.Context, wm wiremessage.Wir
364
364
}
365
365
366
366
startedEvent := & event.CommandStartedEvent {
367
- Context : ctx ,
368
367
ConnectionID : c .id ,
369
368
}
370
369
@@ -418,7 +417,7 @@ func (c *connection) commandStartedEvent(ctx context.Context, wm wiremessage.Wir
418
417
startedEvent .Command = emptyDoc
419
418
}
420
419
421
- c .cmdMonitor .Started (startedEvent )
420
+ c .cmdMonitor .Started (ctx , startedEvent )
422
421
423
422
if ! acknowledged {
424
423
if c .cmdMonitor .Succeeded == nil {
@@ -427,14 +426,13 @@ func (c *connection) commandStartedEvent(ctx context.Context, wm wiremessage.Wir
427
426
428
427
// unack writes must provide a CommandSucceededEvent with an { ok: 1 } reply
429
428
finishedEvent := event.CommandFinishedEvent {
430
- Context : ctx ,
431
429
DurationNanos : 0 ,
432
430
CommandName : startedEvent .CommandName ,
433
431
RequestID : startedEvent .RequestID ,
434
432
ConnectionID : c .id ,
435
433
}
436
434
437
- c .cmdMonitor .Succeeded (& event.CommandSucceededEvent {
435
+ c .cmdMonitor .Succeeded (ctx , & event.CommandSucceededEvent {
438
436
CommandFinishedEvent : finishedEvent ,
439
437
Reply : bson .NewDocument (
440
438
bson .EC .Int32 ("ok" , 1 ),
@@ -522,7 +520,6 @@ func (c *connection) commandFinishedEvent(ctx context.Context, wm wiremessage.Wi
522
520
}
523
521
524
522
finishedEvent := event.CommandFinishedEvent {
525
- Context : ctx ,
526
523
DurationNanos : cmdMetadata .TimeDifference (),
527
524
CommandName : cmdMetadata .Name ,
528
525
RequestID : requestID ,
@@ -535,7 +532,7 @@ func (c *connection) commandFinishedEvent(ctx context.Context, wm wiremessage.Wi
535
532
Reply : emptyDoc ,
536
533
CommandFinishedEvent : finishedEvent ,
537
534
}
538
- c .cmdMonitor .Succeeded (successEvent )
535
+ c .cmdMonitor .Succeeded (ctx , successEvent )
539
536
return nil
540
537
}
541
538
@@ -556,7 +553,7 @@ func (c *connection) commandFinishedEvent(ctx context.Context, wm wiremessage.Wi
556
553
CommandFinishedEvent : finishedEvent ,
557
554
}
558
555
559
- c .cmdMonitor .Succeeded (successEvent )
556
+ c .cmdMonitor .Succeeded (ctx , successEvent )
560
557
return nil
561
558
}
562
559
@@ -565,7 +562,7 @@ func (c *connection) commandFinishedEvent(ctx context.Context, wm wiremessage.Wi
565
562
CommandFinishedEvent : finishedEvent ,
566
563
}
567
564
568
- c .cmdMonitor .Failed (failureEvent )
565
+ c .cmdMonitor .Failed (ctx , failureEvent )
569
566
return nil
570
567
}
571
568
0 commit comments