caminte
caminte copied to clipboard
Programmatically disconnecting MySQL adapater when "autoReconnect" is enabled
Programmatically disconnecting MySQL adapater when "autoReconnect" is enabled it's impossible. The auto-reconnect feature will re-enable connection.
If you call:
const caminte = require('caminte');
let Schema = caminte.Schema;
let _test = new Schema('mysql', {
driver: 'mysql',
host: 127.0.0.1,
database: 'test',
pool: false,
ssl: true,
autoReconnect: true,
debug: false
});
...
_test .disconnect();
Caminte is still connected
Using "autoReconnect" set to false seems to solve the situation.
Problaby the "disconnect" method should clear also the intervals set here or here