File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,9 @@ const (
4444 DisconnectTimeout = 5 * time .Second
4545 // CloseCursorTimeout is the timeout duration for closing cursor.
4646 CloseCursorTimeout = 10 * time .Second
47+ // OperationTimeout is the timeout duration for MonngoDB client operations like
48+ // insert, update, delete, etc.
49+ OperationTimeout = 5 * time .Minute
4750)
4851
4952// Change stream and replication settings.
Original file line number Diff line number Diff line change 55 "net/url"
66 "slices"
77 "strings"
8- "time"
98
109 "go.mongodb.org/mongo-driver/v2/mongo"
1110 "go.mongodb.org/mongo-driver/v2/mongo/options"
@@ -59,7 +58,7 @@ func ConnectWithOptions(
5958 SetReadPreference (readpref .Primary ()).
6059 SetReadConcern (readconcern .Majority ()).
6160 SetWriteConcern (writeconcern .Majority ()).
62- SetTimeout (time . Minute )
61+ SetTimeout (config . OperationTimeout )
6362
6463 if connOpts != nil && connOpts .Compressors != nil {
6564 opts .SetCompressors (connOpts .Compressors )
You can’t perform that action at this time.
0 commit comments