Do not stop CQN notifications that were not started

This commit is contained in:
Christopher Jones 2019-08-14 22:11:26 +10:00
parent 037c817305
commit 7af8400b9d
2 changed files with 9 additions and 6 deletions

View File

@ -442,12 +442,15 @@ bool njsSubscription_startNotifications(njsSubscription *subscr,
// subscription is deregistered, either directly via a call to unsubscribe()
// or indirectly via the timeout attribute or the quality of service flag that
// tells a subscription to deregister after the first notification has been
// received.
// received. If notifications were never started (due to an error of some kind)
// nothing needs to be done at this point.
//-----------------------------------------------------------------------------
bool njsSubscription_stopNotifications(njsSubscription *subscr)
{
uv_close((uv_handle_t*) &subscr->async,
njsSubscription_onStopNotifications);
if (subscr->name) {
uv_close((uv_handle_t*) &subscr->async,
njsSubscription_onStopNotifications);
}
return true;
}

View File

@ -433,7 +433,7 @@ describe('185. runCQN.js', function() {
}); // 185.8
// An variation of 185.4
it.skip('185.9 Negative - unsubscribe the invalid subscription', async () => {
it('185.9 Negative - unsubscribe the invalid subscription', async () => {
try {
const TABLE = 'nodb_tab_cqn_9';
const myCallback = async function(message) {
@ -456,11 +456,11 @@ describe('185. runCQN.js', function() {
);
// DPI-1013: not supported
conn.unsubscribe('sub9');
await conn.unsubscribe('sub9');
} catch (err) {
should.not.exist(err);
}
}); // 185.9
});
});