implement Simulate and globalize BufferLimit

This commit is contained in:
2022-11-09 20:24:57 +02:00
parent c2e4a9eb69
commit 2232a748db
6 changed files with 62 additions and 30 deletions

View File

@@ -15,6 +15,11 @@ const (
DatabaseCommandTimeout = 10 * time.Second
)
var (
BufferLimitBytes int
Simulate bool
)
func MongoTimeout(ctx context.Context) context.Context {
ctx, _ = context.WithTimeout(ctx, DatabaseCommandTimeout) //nolint:lostcancel (cancelled by mongo, should be bug on them //TODO)
return ctx