{"action":"created","comment":{"url":"https://api.github.com/repos/paytm/mysequel/pulls/comments/75592575","id":75592575,"diff_hunk":"@@ -60,6 +60,21 @@ module.exports = function (opt) {\n     });\n   };\n \n+  // Useful for scripts, or graceful shutdown of server\n+  self.close = function(cb) {\n+    if (!pool) return cb();\n+\n+    warn('closing connection pool');\n+\n+    if (typeof cb !== 'function') {","path":"index.js","position":10,"original_position":10,"commit_id":"e722c94672fbc8564035baae2964edb70f2c3a98","original_commit_id":"e722c94672fbc8564035baae2964edb70f2c3a98","user":{"login":"vnykmshr","id":1052344,"avatar_url":"https://avatars.githubusercontent.com/u/1052344?v=3","gravatar_id":"","url":"https://api.github.com/users/vnykmshr","html_url":"https://github.com/vnykmshr","followers_url":"https://api.github.com/users/vnykmshr/followers","following_url":"https://api.github.com/users/vnykmshr/following{/other_user}","gists_url":"https://api.github.com/users/vnykmshr/gists{/gist_id}","starred_url":"https://api.github.com/users/vnykmshr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vnykmshr/subscriptions","organizations_url":"https://api.github.com/users/vnykmshr/orgs","repos_url":"https://api.github.com/users/vnykmshr/repos","events_url":"https://api.github.com/users/vnykmshr/events{/privacy}","received_events_url":"https://api.github.com/users/vnykmshr/received_events","type":"User","site_admin":false},"body":"add this before line 65 ","created_at":"2016-08-21T09:58:34Z","updated_at":"2016-08-21T09:58:34Z","html_url":"https://github.com/paytm/mysequel/pull/1#discussion_r75592575","pull_request_url":"https://api.github.com/repos/paytm/mysequel/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/paytm/mysequel/pulls/comments/75592575"},"html":{"href":"https://github.com/paytm/mysequel/pull/1#discussion_r75592575"},"pull_request":{"href":"https://api.github.com/repos/paytm/mysequel/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/paytm/mysequel/pulls/1","id":81946627,"html_url":"https://github.com/paytm/mysequel/pull/1","diff_url":"https://github.com/paytm/mysequel/pull/1.diff","patch_url":"https://github.com/paytm/mysequel/pull/1.patch","issue_url":"https://api.github.com/repos/paytm/mysequel/issues/1","number":1,"state":"open","locked":false,"title":"Export a `.close()` function as well","user":{"login":"SirR4T","id":2033712,"avatar_url":"https://avatars.githubusercontent.com/u/2033712?v=3","gravatar_id":"","url":"https://api.github.com/users/SirR4T","html_url":"https://github.com/SirR4T","followers_url":"https://api.github.com/users/SirR4T/followers","following_url":"https://api.github.com/users/SirR4T/following{/other_user}","gists_url":"https://api.github.com/users/SirR4T/gists{/gist_id}","starred_url":"https://api.github.com/users/SirR4T/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SirR4T/subscriptions","organizations_url":"https://api.github.com/users/SirR4T/orgs","repos_url":"https://api.github.com/users/SirR4T/repos","events_url":"https://api.github.com/users/SirR4T/events{/privacy}","received_events_url":"https://api.github.com/users/SirR4T/received_events","type":"User","site_admin":false},"body":"As per\r\nhttps://www.npmjs.com/package/mysql#closing-all-the-connections-in-a-pool,\r\nwe would need to call `.end()` on a mysql connection pool, otherwise\r\nthe node event loop will stay active until the mysql server closes the\r\nconnections.\r\n\r\nExposing this through a `.close()` function would be helpful for\r\nscripts, crons, or gracefully restarting a webserver.\r\n\r\n Changes to be committed:\r\n\tmodified:   index.js\r\n\tmodified:   test/test.js","created_at":"2016-08-19T08:50:16Z","updated_at":"2016-08-21T09:58:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7cb6f9f7623ae0baa1d11c4258fdfb69ed8d6dd5","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/paytm/mysequel/pulls/1/commits","review_comments_url":"https://api.github.com/repos/paytm/mysequel/pulls/1/comments","review_comment_url":"https://api.github.com/repos/paytm/mysequel/pulls/comments{/number}","comments_url":"https://api.github.com/repos/paytm/mysequel/issues/1/comments","statuses_url":"https://api.github.com/repos/paytm/mysequel/statuses/e722c94672fbc8564035baae2964edb70f2c3a98","head":{"label":"SirR4T:master","ref":"master","sha":"e722c94672fbc8564035baae2964edb70f2c3a98","user":{"login":"SirR4T","id":2033712,"avatar_url":"https://avatars.githubusercontent.com/u/2033712?v=3","gravatar_id":"","url":"https://api.github.com/users/SirR4T","html_url":"https://github.com/SirR4T","followers_url":"https://api.github.com/users/SirR4T/followers","following_url":"https://api.github.com/users/SirR4T/following{/other_user}","gists_url":"https://api.github.com/users/SirR4T/gists{/gist_id}","starred_url":"https://api.github.com/users/SirR4T/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SirR4T/subscriptions","organizations_url":"https://api.github.com/users/SirR4T/orgs","repos_url":"https://api.github.com/users/SirR4T/repos","events_url":"https://api.github.com/users/SirR4T/events{/privacy}","received_events_url":"https://api.github.com/users/SirR4T/received_events","type":"User","site_admin":false},"repo":{"id":66058486,"name":"mysequel","full_name":"SirR4T/mysequel","owner":{"login":"SirR4T","id":2033712,"avatar_url":"https://avatars.githubusercontent.com/u/2033712?v=3","gravatar_id":"","url":"https://api.github.com/users/SirR4T","html_url":"https://github.com/SirR4T","followers_url":"https://api.github.com/users/SirR4T/followers","following_url":"https://api.github.com/users/SirR4T/following{/other_user}","gists_url":"https://api.github.com/users/SirR4T/gists{/gist_id}","starred_url":"https://api.github.com/users/SirR4T/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SirR4T/subscriptions","organizations_url":"https://api.github.com/users/SirR4T/orgs","repos_url":"https://api.github.com/users/SirR4T/repos","events_url":"https://api.github.com/users/SirR4T/events{/privacy}","received_events_url":"https://api.github.com/users/SirR4T/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/SirR4T/mysequel","description":"anydb-sql, sans the portability layer.","fork":true,"url":"https://api.github.com/repos/SirR4T/mysequel","forks_url":"https://api.github.com/repos/SirR4T/mysequel/forks","keys_url":"https://api.github.com/repos/SirR4T/mysequel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SirR4T/mysequel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SirR4T/mysequel/teams","hooks_url":"https://api.github.com/repos/SirR4T/mysequel/hooks","issue_events_url":"https://api.github.com/repos/SirR4T/mysequel/issues/events{/number}","events_url":"https://api.github.com/repos/SirR4T/mysequel/events","assignees_url":"https://api.github.com/repos/SirR4T/mysequel/assignees{/user}","branches_url":"https://api.github.com/repos/SirR4T/mysequel/branches{/branch}","tags_url":"https://api.github.com/repos/SirR4T/mysequel/tags","blobs_url":"https://api.github.com/repos/SirR4T/mysequel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SirR4T/mysequel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SirR4T/mysequel/git/refs{/sha}","trees_url":"https://api.github.com/repos/SirR4T/mysequel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SirR4T/mysequel/statuses/{sha}","languages_url":"https://api.github.com/repos/SirR4T/mysequel/languages","stargazers_url":"https://api.github.com/repos/SirR4T/mysequel/stargazers","contributors_url":"https://api.github.com/repos/SirR4T/mysequel/contributors","subscribers_url":"https://api.github.com/repos/SirR4T/mysequel/subscribers","subscription_url":"https://api.github.com/repos/SirR4T/mysequel/subscription","commits_url":"https://api.github.com/repos/SirR4T/mysequel/commits{/sha}","git_commits_url":"https://api.github.com/repos/SirR4T/mysequel/git/commits{/sha}","comments_url":"https://api.github.com/repos/SirR4T/mysequel/comments{/number}","issue_comment_url":"https://api.github.com/repos/SirR4T/mysequel/issues/comments{/number}","contents_url":"https://api.github.com/repos/SirR4T/mysequel/contents/{+path}","compare_url":"https://api.github.com/repos/SirR4T/mysequel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SirR4T/mysequel/merges","archive_url":"https://api.github.com/repos/SirR4T/mysequel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SirR4T/mysequel/downloads","issues_url":"https://api.github.com/repos/SirR4T/mysequel/issues{/number}","pulls_url":"https://api.github.com/repos/SirR4T/mysequel/pulls{/number}","milestones_url":"https://api.github.com/repos/SirR4T/mysequel/milestones{/number}","notifications_url":"https://api.github.com/repos/SirR4T/mysequel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SirR4T/mysequel/labels{/name}","releases_url":"https://api.github.com/repos/SirR4T/mysequel/releases{/id}","deployments_url":"https://api.github.com/repos/SirR4T/mysequel/deployments","created_at":"2016-08-19T06:28:34Z","updated_at":"2016-08-19T06:28:34Z","pushed_at":"2016-08-19T08:47:15Z","git_url":"git://github.com/SirR4T/mysequel.git","ssh_url":"git@github.com:SirR4T/mysequel.git","clone_url":"https://github.com/SirR4T/mysequel.git","svn_url":"https://github.com/SirR4T/mysequel","homepage":"","size":10,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"paytm:master","ref":"master","sha":"ca98dd5ae346bf69c9c8d94bb7ff8d165bb5c076","user":{"login":"paytm","id":1472420,"avatar_url":"https://avatars.githubusercontent.com/u/1472420?v=3","gravatar_id":"","url":"https://api.github.com/users/paytm","html_url":"https://github.com/paytm","followers_url":"https://api.github.com/users/paytm/followers","following_url":"https://api.github.com/users/paytm/following{/other_user}","gists_url":"https://api.github.com/users/paytm/gists{/gist_id}","starred_url":"https://api.github.com/users/paytm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paytm/subscriptions","organizations_url":"https://api.github.com/users/paytm/orgs","repos_url":"https://api.github.com/users/paytm/repos","events_url":"https://api.github.com/users/paytm/events{/privacy}","received_events_url":"https://api.github.com/users/paytm/received_events","type":"Organization","site_admin":false},"repo":{"id":40242535,"name":"mysequel","full_name":"paytm/mysequel","owner":{"login":"paytm","id":1472420,"avatar_url":"https://avatars.githubusercontent.com/u/1472420?v=3","gravatar_id":"","url":"https://api.github.com/users/paytm","html_url":"https://github.com/paytm","followers_url":"https://api.github.com/users/paytm/followers","following_url":"https://api.github.com/users/paytm/following{/other_user}","gists_url":"https://api.github.com/users/paytm/gists{/gist_id}","starred_url":"https://api.github.com/users/paytm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paytm/subscriptions","organizations_url":"https://api.github.com/users/paytm/orgs","repos_url":"https://api.github.com/users/paytm/repos","events_url":"https://api.github.com/users/paytm/events{/privacy}","received_events_url":"https://api.github.com/users/paytm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/paytm/mysequel","description":"anydb-sql, sans the portability layer.","fork":true,"url":"https://api.github.com/repos/paytm/mysequel","forks_url":"https://api.github.com/repos/paytm/mysequel/forks","keys_url":"https://api.github.com/repos/paytm/mysequel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/paytm/mysequel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/paytm/mysequel/teams","hooks_url":"https://api.github.com/repos/paytm/mysequel/hooks","issue_events_url":"https://api.github.com/repos/paytm/mysequel/issues/events{/number}","events_url":"https://api.github.com/repos/paytm/mysequel/events","assignees_url":"https://api.github.com/repos/paytm/mysequel/assignees{/user}","branches_url":"https://api.github.com/repos/paytm/mysequel/branches{/branch}","tags_url":"https://api.github.com/repos/paytm/mysequel/tags","blobs_url":"https://api.github.com/repos/paytm/mysequel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/paytm/mysequel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/paytm/mysequel/git/refs{/sha}","trees_url":"https://api.github.com/repos/paytm/mysequel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/paytm/mysequel/statuses/{sha}","languages_url":"https://api.github.com/repos/paytm/mysequel/languages","stargazers_url":"https://api.github.com/repos/paytm/mysequel/stargazers","contributors_url":"https://api.github.com/repos/paytm/mysequel/contributors","subscribers_url":"https://api.github.com/repos/paytm/mysequel/subscribers","subscription_url":"https://api.github.com/repos/paytm/mysequel/subscription","commits_url":"https://api.github.com/repos/paytm/mysequel/commits{/sha}","git_commits_url":"https://api.github.com/repos/paytm/mysequel/git/commits{/sha}","comments_url":"https://api.github.com/repos/paytm/mysequel/comments{/number}","issue_comment_url":"https://api.github.com/repos/paytm/mysequel/issues/comments{/number}","contents_url":"https://api.github.com/repos/paytm/mysequel/contents/{+path}","compare_url":"https://api.github.com/repos/paytm/mysequel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/paytm/mysequel/merges","archive_url":"https://api.github.com/repos/paytm/mysequel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/paytm/mysequel/downloads","issues_url":"https://api.github.com/repos/paytm/mysequel/issues{/number}","pulls_url":"https://api.github.com/repos/paytm/mysequel/pulls{/number}","milestones_url":"https://api.github.com/repos/paytm/mysequel/milestones{/number}","notifications_url":"https://api.github.com/repos/paytm/mysequel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/paytm/mysequel/labels{/name}","releases_url":"https://api.github.com/repos/paytm/mysequel/releases{/id}","deployments_url":"https://api.github.com/repos/paytm/mysequel/deployments","created_at":"2015-08-05T11:52:25Z","updated_at":"2015-08-05T11:52:28Z","pushed_at":"2016-08-19T08:50:16Z","git_url":"git://github.com/paytm/mysequel.git","ssh_url":"git@github.com:paytm/mysequel.git","clone_url":"https://github.com/paytm/mysequel.git","svn_url":"https://github.com/paytm/mysequel","homepage":"","size":117,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/paytm/mysequel/pulls/1"},"html":{"href":"https://github.com/paytm/mysequel/pull/1"},"issue":{"href":"https://api.github.com/repos/paytm/mysequel/issues/1"},"comments":{"href":"https://api.github.com/repos/paytm/mysequel/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/paytm/mysequel/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/paytm/mysequel/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/paytm/mysequel/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/paytm/mysequel/statuses/e722c94672fbc8564035baae2964edb70f2c3a98"}}}}
{"actor":{"display_login":"vnykmshr"}}