Skip to content

Commit 664a2e4

Browse files
committed
Merge branch 'pr/140'
GODRIVER-833 Change-Id: I4d54a121fb62015e274e66291861373b5f75d708
2 parents 32946b1 + 7d18372 commit 664a2e4

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

mongo/gridfs/bucket.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import (
3030
// TODO: add sessions options
3131

3232
// DefaultChunkSize is the default size of each file chunk.
33-
const DefaultChunkSize int32 = 255 * 1000 // 255 KB
33+
const DefaultChunkSize int32 = 255 * 1024 // 255 KiB
3434

3535
// ErrFileNotFound occurs if a user asks to download a file with a file ID that isn't found in the files collection.
3636
var ErrFileNotFound = errors.New("file with given parameters not found")

mongo/gridfs/upload_stream.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121

2222
// UploadBufferSize is the size in bytes of one stream batch. Chunks will be written to the db after the sum of chunk
2323
// lengths is equal to the batch size.
24-
const UploadBufferSize = 16 * 1000000 // 16 MB
24+
const UploadBufferSize = 16 * 1024 * 1024 // 16 MiB
2525

2626
// ErrStreamClosed is an error returned if an operation is attempted on a closed/aborted stream.
2727
var ErrStreamClosed = errors.New("stream is closed or aborted")

mongo/options/gridfsoptions.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
var DefaultName = "fs"
2020

2121
// DefaultChunkSize is the default size of each file chunk in bytes.
22-
var DefaultChunkSize int32 = 255 * 1000
22+
var DefaultChunkSize int32 = 255 * 1024 // 255 KiB
2323

2424
// DefaultRevision is the default revision number for a download by name operation.
2525
var DefaultRevision int32 = -1

0 commit comments

Comments
 (0)