Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions lib/gridfs-stream/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,11 +298,18 @@ function init(self) {
return;
}

self.s.cursor = self.s.chunks.find({ files_id: doc._id }).sort({ n: 1 });
self.s.cursor = self.s.chunks.find({ files_id: doc._id }, {
//noCursorTimeout: true, // doesn't affect
//maxTimeMS: 5000, // doesn't affect
batchSize: 15
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I started to get cursor timeout after 15/30+ chunks

}).sort({ n: 1 });
if (self.s.readPreference) {
self.s.cursor.setReadPreference(self.s.readPreference);
}


// doesn't affect
//self.s.cursor.addCursorFlag('noCursorTimeout', true);

self.s.expectedEnd = Math.ceil(doc.length / doc.chunkSize);
self.s.file = doc;
self.s.bytesToSkip = handleStartOption(self, doc, self.s.cursor,
Expand Down