{"action":"created","issue":{"url":"https://api.github.com/repos/Automattic/monk/issues/170","repository_url":"https://api.github.com/repos/Automattic/monk","labels_url":"https://api.github.com/repos/Automattic/monk/issues/170/labels{/name}","comments_url":"https://api.github.com/repos/Automattic/monk/issues/170/comments","events_url":"https://api.github.com/repos/Automattic/monk/issues/170/events","html_url":"https://github.com/Automattic/monk/issues/170","id":187483669,"number":170,"title":"Are there any event handlers to deal with the \"error-opening\" event","user":{"login":"rightm","id":5675051,"avatar_url":"https://avatars.githubusercontent.com/u/5675051?v=3","gravatar_id":"","url":"https://api.github.com/users/rightm","html_url":"https://github.com/rightm","followers_url":"https://api.github.com/users/rightm/followers","following_url":"https://api.github.com/users/rightm/following{/other_user}","gists_url":"https://api.github.com/users/rightm/gists{/gist_id}","starred_url":"https://api.github.com/users/rightm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rightm/subscriptions","organizations_url":"https://api.github.com/users/rightm/orgs","repos_url":"https://api.github.com/users/rightm/repos","events_url":"https://api.github.com/users/rightm/events{/privacy}","received_events_url":"https://api.github.com/users/rightm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-05T08:04:32Z","updated_at":"2016-11-06T00:02:20Z","closed_at":null,"body":"mongodb : 2.1.18\r\nmonk version:3.1.2\r\nwhen my mongo is down ,then i can not get anything .so i add a callback in Manager.prototype.then \r\n,i got the error below :\r\n``\r\n(node) warning: possible EventEmitter memory leak detected. 11 error-opening listeners added. Use ```\r\n\r\n> emitter.setMaxListeners() to increase limit.\r\n> Trace\r\n>     at Manager.addListener (events.js:252:17)\r\n>     at Manager.once (events.js:278:8)\r\n>     at Manager.<anonymous> (E:\\git\\NatureCloud\\node_modules\\monk\\lib\\manager.js:175:10)\r\n>     at Manager.then (E:\\git\\NatureCloud\\node_modules\\monk\\lib\\manager.js:173:10)\r\n>     at storageMetaInfoDB.myMongoDB (E:\\git\\NatureCloud\\db\\mongodb.js:13:10)\r\n>     at new storageMetaInfoDB (E:\\git\\NatureCloud\\db\\storageMetaInfoDB.js:12:10)\r\n>     at Object.<anonymous> (E:\\git\\NatureCloud\\lib\\k8s\\kubernetes.js:30:21)\r\n>     at Module._compile (module.js:413:34)\r\n>     at Object.Module._extensions..js (module.js:422:10)\r\n>     at Module.load (module.js:357:32)\r\n\r\n```\r\n\r\n i hava to add a   callback function in Manager.prototype.then or  Manager.prototype.catch to get what happened ?\r\n"},"comment":{"url":"https://api.github.com/repos/Automattic/monk/issues/comments/258650740","html_url":"https://github.com/Automattic/monk/issues/170#issuecomment-258650740","issue_url":"https://api.github.com/repos/Automattic/monk/issues/170","id":258650740,"user":{"login":"mathieudutour","id":3254314,"avatar_url":"https://avatars.githubusercontent.com/u/3254314?v=3","gravatar_id":"","url":"https://api.github.com/users/mathieudutour","html_url":"https://github.com/mathieudutour","followers_url":"https://api.github.com/users/mathieudutour/followers","following_url":"https://api.github.com/users/mathieudutour/following{/other_user}","gists_url":"https://api.github.com/users/mathieudutour/gists{/gist_id}","starred_url":"https://api.github.com/users/mathieudutour/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mathieudutour/subscriptions","organizations_url":"https://api.github.com/users/mathieudutour/orgs","repos_url":"https://api.github.com/users/mathieudutour/repos","events_url":"https://api.github.com/users/mathieudutour/events{/privacy}","received_events_url":"https://api.github.com/users/mathieudutour/received_events","type":"User","site_admin":false},"created_at":"2016-11-06T00:02:20Z","updated_at":"2016-11-06T00:02:20Z","body":"It's just a warning, you can (based on the information you gave) safely ignore it.\r\n\r\nWhat is happening?\r\nWhen you start using monk, you usually don't wait for the connection to do queries:\r\n```\r\nconst db = monk()\r\n\r\ndb.get('users').find()\r\n```\r\n\r\nLet's say we have 15 queries like this throughout the node app. Each of those queries will register an event listener to know when they will actually be able to query the database. Once the connection is opened (or closed), the event listeners are freed.\r\n\r\nDoes it answer your question or did I misunderstood? "}}
{"actor":{"display_login":"mathieudutour"}}