Scaffold an LB application using slc lb project and configure a mysql datasource named db.
Run the following script:
var app = require('./app.js');
app.dataSources.db.discoverModelDefinitions(function(err, data) {
console.log(Array.prototype.slice.call(arguments));
});
After the callback is called, the script continues to run. Probably the mysql connection pool is preventing the app from exit.
Expected behaviour: any background connections are unref-ed, so that the script ends.
The dataSource has a disconnect() api which will shuts down the connection pool. Can you try?
The dataSource has a disconnect() api which will shuts down the connection pool. Can you try?
That works like a charm :+1:
Most helpful comment
The dataSource has a disconnect() api which will shuts down the connection pool. Can you try?