Reputation: 7998
I'm probably overseeing something very basic, but I have this basic strongloop custom script which is suppose to do some data cleanup.
The scripts runs fine, this is not the problem, does all it is suppose to do (all console.log are printed) but the process never exits.
Is there something I have to do to end strongloop?
var app = require('../server/server');
app.models.product.find({}, (err, result) => {
console.log('result', result);
//Do data cleanup
console.log('done now');
});
Upvotes: 1
Views: 53
Reputation: 7998
Ok seems a connection to the mysql server was kept open. If I manually disconnect the process exits nice and tidy.
var app = require('../server/server');
app.models.product.find({}, (err, result) => {
console.log('result', result);
//Do data cleanup
//Disconnect datasource
app.dataSources.mysqldb.disconnect();
console.log('done now');
});
console.log('end of file');
Upvotes: 1