chill117/express-mysql-session — pull request #8 by ravenscar (2014-11-26 10:42:38+00:00)
Title: add closeStore() method to facilitate in clean shutdown of express

When shutting down express the expiration interval should be cleared and the DB connection/pool should be ended (along with clearing the keepalive interval the manager sets). This is dependent on the endConnection() method being present on the manager.

E.g. if you have the following setup:

SessionStore = require('express-mysql-session');
session_store = new SessionStore(session_config);

to cleanly end you would previously have had to do this:

session_store.clearExpirationInterval();
session_store.connection._MySQLConnectionManager.clearKeepAliveInterval();
session_store.connection.end();

and now you do:

session_store.closeStore();

this is dependent on pull request: https://github.com/chill117/mysql-connection-manager/pull/3