Skip to content

Commit

Permalink
replace options
Browse files Browse the repository at this point in the history
  • Loading branch information
emmansun committed Nov 21, 2023
1 parent 495c5f3 commit 23e3e0b
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions lib/channel.js
Expand Up @@ -29,7 +29,6 @@ class Channel extends EventEmitter {
max: options.max
}

this.options = options
this.connection = connection
this.closed = false
this.listening = null
Expand Down Expand Up @@ -171,11 +170,9 @@ class Channel extends EventEmitter {
tailable: true,
awaitData: true,
timeout: false,
sortValue: { $natural: -1 },
numberOfRetries: Number.MAX_VALUE,
tailableRetryInterval: self.options.retryInterval
maxAwaitTimeMS: self.options.retryInterval
}
)
).hint({ $natural: 1 })
const next = self.handle(function (doc) {
// There is no document only if the cursor is closed by accident.
// F.e. if collection was dropped or connection died.
Expand Down Expand Up @@ -227,7 +224,7 @@ class Channel extends EventEmitter {
function onCollection (collection) {
const cursor = collection
.find(latest ? { _id: latest._id } : {}, { timeout: false })
.sort({ $natural: -1 })
.hint({ $natural: -1 })
.limit(1)
cursor
.next()
Expand Down

0 comments on commit 23e3e0b

Please sign in to comment.