mongochangestream
Advanced tools
Comparing version 0.39.0 to 0.40.0
@@ -0,1 +1,5 @@ | ||
# 0.40.0 | ||
- Don't emit the `cursorError` event when stopping. | ||
# 0.39.0 | ||
@@ -2,0 +6,0 @@ |
@@ -197,4 +197,4 @@ "use strict"; | ||
await queue.flush(); | ||
// An error occurred checking for next | ||
if (nextChecker.errorExists()) { | ||
// An error occurred getting next and we are not stopping | ||
if (nextChecker.errorExists() && !state.is('stopping')) { | ||
emit('cursorError', { | ||
@@ -205,4 +205,4 @@ name: 'runInitialScan', | ||
} | ||
// We're all done | ||
else { | ||
// Exited cleanly from the loop so we're done | ||
if (!nextChecker.errorExists()) { | ||
debug('Completed initial scan'); | ||
@@ -307,4 +307,4 @@ // Record scan complete | ||
} | ||
// Emit | ||
if (nextChecker.errorExists()) { | ||
// An error occurred getting next and we are not stopping | ||
if (nextChecker.errorExists() && !state.is('stopping')) { | ||
emit('cursorError', { | ||
@@ -311,0 +311,0 @@ name: 'processChangeStream', |
{ | ||
"name": "mongochangestream", | ||
"version": "0.39.0", | ||
"version": "0.40.0", | ||
"description": "Sync MongoDB collections via change streams into any database.", | ||
@@ -5,0 +5,0 @@ "author": "GovSpend", |
@@ -226,3 +226,6 @@ /** | ||
}) | ||
sync.emitter.on('cursorError', console.log) | ||
let cursorError = false | ||
sync.emitter.on('cursorError', () => { | ||
cursorError = true | ||
}) | ||
// Start | ||
@@ -234,2 +237,4 @@ initialScan.start() | ||
await initialScan.stop() | ||
// Should not emit cursorError when stopping | ||
assert.equal(cursorError, false) | ||
// Wait for the initial scan to complete | ||
@@ -313,2 +318,6 @@ initialScan.start() | ||
let cursorError = false | ||
sync.emitter.on('cursorError', () => { | ||
cursorError = true | ||
}) | ||
const processed = [] | ||
@@ -330,2 +339,4 @@ const processRecord = async (doc: ChangeStreamDocument) => { | ||
await changeStream.stop() | ||
// Should not emit cursorError when stopping | ||
assert.equal(cursorError, false) | ||
}) | ||
@@ -332,0 +343,0 @@ |
@@ -249,4 +249,4 @@ import _ from 'lodash/fp.js' | ||
await queue.flush() | ||
// An error occurred checking for next | ||
if (nextChecker.errorExists()) { | ||
// An error occurred getting next and we are not stopping | ||
if (nextChecker.errorExists() && !state.is('stopping')) { | ||
emit('cursorError', { | ||
@@ -257,4 +257,4 @@ name: 'runInitialScan', | ||
} | ||
// We're all done | ||
else { | ||
// Exited cleanly from the loop so we're done | ||
if (!nextChecker.errorExists()) { | ||
debug('Completed initial scan') | ||
@@ -373,4 +373,4 @@ // Record scan complete | ||
} | ||
// Emit | ||
if (nextChecker.errorExists()) { | ||
// An error occurred getting next and we are not stopping | ||
if (nextChecker.errorExists() && !state.is('stopping')) { | ||
emit('cursorError', { | ||
@@ -377,0 +377,0 @@ name: 'processChangeStream', |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
85981
2124