bestlong / node-red-contrib-mssql-plus

A Node-RED node to read and write to Microsoft MS SQL Databases
MIT License
31 stars 18 forks source link

Prevent node-red crash on exit #92

Closed Steve-Mcl closed 4 months ago

Steve-Mcl commented 6 months ago

handle the fact pool.close is now a promise.

This fix is only to contain the issue raised in #91

A future change is necessary to make the node.on('close', callback should be async and the .disconnect through to connectionCleanup functions should await so that we correctly inform node-red that it is OK to close

        node.on('close', function () {
            mssqlCN.disconnect(node.id);
        });

NOTE: this is untested - will request review before merge.

bombjackit commented 4 months ago

@bestlong and @Steve-Mcl in my environment this commit works as expected.

Steve-Mcl commented 4 months ago

@bestlong are you able to review and merge?

bombjackit commented 4 months ago

@Steve-Mcl could you change dependecies of this node to use at minimun version 10.0.2 of node mssql ? In this version there are another node-red related bug fix (see https://github.com/tediousjs/node-mssql/pull/1592).

Thanks in adnvance

Steve-Mcl commented 4 months ago

@Steve-Mcl could you change dependecies of this node to use at minimun version 10.0.2 of node mssql ? In this version there are another node-red related bug fix (see tediousjs/node-mssql#1592).

Thanks in adnvance

@bombjackit dependency ^10.0.2 satisfies constraint ^10.0.0. npm install should pull the newer dependency.

You can check this by running npm list mssql in the .node-red directory to confirm.