destroy-manager.js 2.3 KB

123456789101112131415161718192021222324252627282930
  1. // ██████╗ ███████╗███████╗████████╗██████╗ ██████╗ ██╗ ██╗
  2. // ██╔══██╗██╔════╝██╔════╝╚══██╔══╝██╔══██╗██╔═══██╗╚██╗ ██╔╝
  3. // ██║ ██║█████╗ ███████╗ ██║ ██████╔╝██║ ██║ ╚████╔╝
  4. // ██║ ██║██╔══╝ ╚════██║ ██║ ██╔══██╗██║ ██║ ╚██╔╝
  5. // ██████╔╝███████╗███████║ ██║ ██║ ██║╚██████╔╝ ██║
  6. // ╚═════╝ ╚══════╝╚══════╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝
  7. //
  8. // ███╗ ███╗ █████╗ ███╗ ██╗ █████╗ ██████╗ ███████╗██████╗
  9. // ████╗ ████║██╔══██╗████╗ ██║██╔══██╗██╔════╝ ██╔════╝██╔══██╗
  10. // ██╔████╔██║███████║██╔██╗ ██║███████║██║ ███╗█████╗ ██████╔╝
  11. // ██║╚██╔╝██║██╔══██║██║╚██╗██║██╔══██║██║ ██║██╔══╝ ██╔══██╗
  12. // ██║ ╚═╝ ██║██║ ██║██║ ╚████║██║ ██║╚██████╔╝███████╗██║ ██║
  13. // ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═══╝╚═╝ ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝
  14. //
  15. // Destroys a connection manager.
  16. var MySQL = require('machinepack-mysql');
  17. module.exports = function destroyManager(manager, cb) {
  18. MySQL.destroyManager({
  19. manager: manager
  20. })
  21. .exec(function destroyManagerCb(err) {
  22. if (err) {
  23. return cb(new Error('There was an error destroying the connection manager.\n\n' + err.stack));
  24. }
  25. return cb();
  26. });
  27. };