fall back to not panicking if replication isn't enabled...
This commit is contained in:
parent
325534a7d0
commit
a91f4b6af8
@ -337,7 +337,9 @@ func innerWatch(coll *mongo.Collection) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
stream, err := coll.Watch(context.TODO(), sspipeline, options.ChangeStream().SetFullDocument(options.UpdateLookup).SetFullDocumentBeforeChange(options.WhenAvailable))
|
stream, err := coll.Watch(context.TODO(), sspipeline, options.ChangeStream().SetFullDocument(options.UpdateLookup).SetFullDocumentBeforeChange(options.WhenAvailable))
|
||||||
panik(err)
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
defer func(stream *mongo.ChangeStream, ctx context2.Context) {
|
defer func(stream *mongo.ChangeStream, ctx context2.Context) {
|
||||||
err := stream.Close(ctx)
|
err := stream.Close(ctx)
|
||||||
panik(err)
|
panik(err)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user