@@ -358,7 +358,7 @@ func canMonitor(cmd string) bool {
358
358
return true
359
359
}
360
360
361
- func (c * connection ) commandStartedEvent (wm wiremessage.WireMessage ) error {
361
+ func (c * connection ) commandStartedEvent (ctx context. Context , wm wiremessage.WireMessage ) error {
362
362
if c .cmdMonitor == nil || c .cmdMonitor .Started == nil {
363
363
return nil
364
364
}
@@ -417,7 +417,7 @@ func (c *connection) commandStartedEvent(wm wiremessage.WireMessage) error {
417
417
startedEvent .Command = emptyDoc
418
418
}
419
419
420
- c .cmdMonitor .Started (startedEvent )
420
+ c .cmdMonitor .Started (ctx , startedEvent )
421
421
422
422
if ! acknowledged {
423
423
if c .cmdMonitor .Succeeded == nil {
@@ -432,7 +432,7 @@ func (c *connection) commandStartedEvent(wm wiremessage.WireMessage) error {
432
432
ConnectionID : c .id ,
433
433
}
434
434
435
- c .cmdMonitor .Succeeded (& event.CommandSucceededEvent {
435
+ c .cmdMonitor .Succeeded (ctx , & event.CommandSucceededEvent {
436
436
CommandFinishedEvent : finishedEvent ,
437
437
Reply : bson .NewDocument (
438
438
bson .EC .Int32 ("ok" , 1 ),
@@ -489,7 +489,7 @@ func processReply(reply *bson.Document) (bool, string) {
489
489
return false , fullErrMsg
490
490
}
491
491
492
- func (c * connection ) commandFinishedEvent (wm wiremessage.WireMessage ) error {
492
+ func (c * connection ) commandFinishedEvent (ctx context. Context , wm wiremessage.WireMessage ) error {
493
493
if c .cmdMonitor == nil {
494
494
return nil
495
495
}
@@ -532,7 +532,7 @@ func (c *connection) commandFinishedEvent(wm wiremessage.WireMessage) error {
532
532
Reply : emptyDoc ,
533
533
CommandFinishedEvent : finishedEvent ,
534
534
}
535
- c .cmdMonitor .Succeeded (successEvent )
535
+ c .cmdMonitor .Succeeded (ctx , successEvent )
536
536
return nil
537
537
}
538
538
@@ -553,7 +553,7 @@ func (c *connection) commandFinishedEvent(wm wiremessage.WireMessage) error {
553
553
CommandFinishedEvent : finishedEvent ,
554
554
}
555
555
556
- c .cmdMonitor .Succeeded (successEvent )
556
+ c .cmdMonitor .Succeeded (ctx , successEvent )
557
557
return nil
558
558
}
559
559
@@ -562,7 +562,7 @@ func (c *connection) commandFinishedEvent(wm wiremessage.WireMessage) error {
562
562
CommandFinishedEvent : finishedEvent ,
563
563
}
564
564
565
- c .cmdMonitor .Failed (failureEvent )
565
+ c .cmdMonitor .Failed (ctx , failureEvent )
566
566
return nil
567
567
}
568
568
@@ -639,7 +639,7 @@ func (c *connection) WriteWireMessage(ctx context.Context, wm wiremessage.WireMe
639
639
}
640
640
641
641
c .bumpIdleDeadline ()
642
- err = c .commandStartedEvent (wm )
642
+ err = c .commandStartedEvent (ctx , wm )
643
643
if err != nil {
644
644
return err
645
645
}
@@ -790,7 +790,7 @@ func (c *connection) ReadWireMessage(ctx context.Context) (wiremessage.WireMessa
790
790
}
791
791
792
792
c .bumpIdleDeadline ()
793
- err = c .commandFinishedEvent (wm )
793
+ err = c .commandFinishedEvent (ctx , wm )
794
794
if err != nil {
795
795
return nil , err // TODO: do we care if monitoring fails?
796
796
}
0 commit comments