caminte icon indicating copy to clipboard operation
caminte copied to clipboard

Programmatically disconnecting MySQL adapater when "autoReconnect" is enabled

Open KingRial opened this issue 6 years ago • 0 comments

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

KingRial avatar Apr 30 '18 08:04 KingRial