{"action":"created","comment":{"url":"https://api.github.com/repos/Bernie-2016/ground-control/pulls/comments/47309095","id":47309095,"diff_hunk":"@@ -0,0 +1,72 @@\n+var pg = require('pg');\n+\n+var connString = process.env.DATABASE_URL;\n+var client;\n+\n+module.exports = {};\n+\n+// The default callback allows us to log errors to the console in the event our\n+// function is called syncronously.\n+// This is prefered over throwing since compilers don't optimize functions\n+// containing throw statements.\n+var default_cb = module.exports.default_callback = function default_cb(e) {\n+  if(e) {\n+    console.error(e.stack);\n+  }\n+};\n+\n+// Query the database\n+module.exports.job = function bsd_assigned_calls_ttl_job(cb) {\n+  // If this function wasn't supplied a callback, use the default\n+  cb = cb || default_cb\n+\n+  // Make sure the client exists\n+  if(!client) module.exports.init(function fallback_init(e) {","path":"src/jobs/jobs/bsd_assigned_calls_ttl.js","position":24,"original_position":24,"commit_id":"ebada19e86c5475903b21ad6fcd9b295a22b366b","original_commit_id":"ebada19e86c5475903b21ad6fcd9b295a22b366b","user":{"login":"saikat","id":83782,"avatar_url":"https://avatars.githubusercontent.com/u/83782?v=3","gravatar_id":"","url":"https://api.github.com/users/saikat","html_url":"https://github.com/saikat","followers_url":"https://api.github.com/users/saikat/followers","following_url":"https://api.github.com/users/saikat/following{/other_user}","gists_url":"https://api.github.com/users/saikat/gists{/gist_id}","starred_url":"https://api.github.com/users/saikat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saikat/subscriptions","organizations_url":"https://api.github.com/users/saikat/orgs","repos_url":"https://api.github.com/users/saikat/repos","events_url":"https://api.github.com/users/saikat/events{/privacy}","received_events_url":"https://api.github.com/users/saikat/received_events","type":"User","site_admin":false},"body":"Why do the separate init and job methods anyway instead of chaining the whole thing into one callback structure?  That way you don't need to do this check.","created_at":"2015-12-11T00:46:23Z","updated_at":"2015-12-11T00:46:23Z","html_url":"https://github.com/Bernie-2016/ground-control/pull/185#discussion_r47309095","pull_request_url":"https://api.github.com/repos/Bernie-2016/ground-control/pulls/185","_links":{"self":{"href":"https://api.github.com/repos/Bernie-2016/ground-control/pulls/comments/47309095"},"html":{"href":"https://github.com/Bernie-2016/ground-control/pull/185#discussion_r47309095"},"pull_request":{"href":"https://api.github.com/repos/Bernie-2016/ground-control/pulls/185"}}},"pull_request":{"url":"https://api.github.com/repos/Bernie-2016/ground-control/pulls/185","id":53336824,"html_url":"https://github.com/Bernie-2016/ground-control/pull/185","diff_url":"https://github.com/Bernie-2016/ground-control/pull/185.diff","patch_url":"https://github.com/Bernie-2016/ground-control/pull/185.patch","issue_url":"https://api.github.com/repos/Bernie-2016/ground-control/issues/185","number":185,"state":"open","locked":false,"title":"Finishes #150","user":{"login":"wblankenship","id":1081565,"avatar_url":"https://avatars.githubusercontent.com/u/1081565?v=3","gravatar_id":"","url":"https://api.github.com/users/wblankenship","html_url":"https://github.com/wblankenship","followers_url":"https://api.github.com/users/wblankenship/followers","following_url":"https://api.github.com/users/wblankenship/following{/other_user}","gists_url":"https://api.github.com/users/wblankenship/gists{/gist_id}","starred_url":"https://api.github.com/users/wblankenship/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wblankenship/subscriptions","organizations_url":"https://api.github.com/users/wblankenship/orgs","repos_url":"https://api.github.com/users/wblankenship/repos","events_url":"https://api.github.com/users/wblankenship/events{/privacy}","received_events_url":"https://api.github.com/users/wblankenship/received_events","type":"User","site_admin":false},"body":"This PR:\r\n\r\n * Adds job to the procfile for dev. (need to discuss production)\r\n * Implements a scheduler for our recurring jobs.\r\n * Implements job to clear out calls that haven't been touched in 1 hour.\r\n * Created README.md detailing how to use the scheduler.\r\n\r\nWas too lazy to cherry pick. So this also does:\r\n\r\n* Changed Linux instructions\r\n  * Implemented `setup-linux` for bootstrapping local dev\r\n  * Removed all docker containers for ground-control\r\n  * Updated README.md with new instructions\r\n* Added Environment Variables to README.md","created_at":"2015-12-11T00:09:01Z","updated_at":"2015-12-11T00:46:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"aa4c5acecdbed77469d87cfccc02da6d41dcc622","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Bernie-2016/ground-control/pulls/185/commits","review_comments_url":"https://api.github.com/repos/Bernie-2016/ground-control/pulls/185/comments","review_comment_url":"https://api.github.com/repos/Bernie-2016/ground-control/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Bernie-2016/ground-control/issues/185/comments","statuses_url":"https://api.github.com/repos/Bernie-2016/ground-control/statuses/ebada19e86c5475903b21ad6fcd9b295a22b366b","head":{"label":"Bernie-2016:bsd_assigned_calls_ttl","ref":"bsd_assigned_calls_ttl","sha":"ebada19e86c5475903b21ad6fcd9b295a22b366b","user":{"login":"Bernie-2016","id":14190141,"avatar_url":"https://avatars.githubusercontent.com/u/14190141?v=3","gravatar_id":"","url":"https://api.github.com/users/Bernie-2016","html_url":"https://github.com/Bernie-2016","followers_url":"https://api.github.com/users/Bernie-2016/followers","following_url":"https://api.github.com/users/Bernie-2016/following{/other_user}","gists_url":"https://api.github.com/users/Bernie-2016/gists{/gist_id}","starred_url":"https://api.github.com/users/Bernie-2016/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bernie-2016/subscriptions","organizations_url":"https://api.github.com/users/Bernie-2016/orgs","repos_url":"https://api.github.com/users/Bernie-2016/repos","events_url":"https://api.github.com/users/Bernie-2016/events{/privacy}","received_events_url":"https://api.github.com/users/Bernie-2016/received_events","type":"Organization","site_admin":false},"repo":{"id":44125682,"name":"ground-control","full_name":"Bernie-2016/ground-control","owner":{"login":"Bernie-2016","id":14190141,"avatar_url":"https://avatars.githubusercontent.com/u/14190141?v=3","gravatar_id":"","url":"https://api.github.com/users/Bernie-2016","html_url":"https://github.com/Bernie-2016","followers_url":"https://api.github.com/users/Bernie-2016/followers","following_url":"https://api.github.com/users/Bernie-2016/following{/other_user}","gists_url":"https://api.github.com/users/Bernie-2016/gists{/gist_id}","starred_url":"https://api.github.com/users/Bernie-2016/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bernie-2016/subscriptions","organizations_url":"https://api.github.com/users/Bernie-2016/orgs","repos_url":"https://api.github.com/users/Bernie-2016/repos","events_url":"https://api.github.com/users/Bernie-2016/events{/privacy}","received_events_url":"https://api.github.com/users/Bernie-2016/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Bernie-2016/ground-control","description":"Central volunteer and data portal","fork":false,"url":"https://api.github.com/repos/Bernie-2016/ground-control","forks_url":"https://api.github.com/repos/Bernie-2016/ground-control/forks","keys_url":"https://api.github.com/repos/Bernie-2016/ground-control/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Bernie-2016/ground-control/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Bernie-2016/ground-control/teams","hooks_url":"https://api.github.com/repos/Bernie-2016/ground-control/hooks","issue_events_url":"https://api.github.com/repos/Bernie-2016/ground-control/issues/events{/number}","events_url":"https://api.github.com/repos/Bernie-2016/ground-control/events","assignees_url":"https://api.github.com/repos/Bernie-2016/ground-control/assignees{/user}","branches_url":"https://api.github.com/repos/Bernie-2016/ground-control/branches{/branch}","tags_url":"https://api.github.com/repos/Bernie-2016/ground-control/tags","blobs_url":"https://api.github.com/repos/Bernie-2016/ground-control/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Bernie-2016/ground-control/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Bernie-2016/ground-control/git/refs{/sha}","trees_url":"https://api.github.com/repos/Bernie-2016/ground-control/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Bernie-2016/ground-control/statuses/{sha}","languages_url":"https://api.github.com/repos/Bernie-2016/ground-control/languages","stargazers_url":"https://api.github.com/repos/Bernie-2016/ground-control/stargazers","contributors_url":"https://api.github.com/repos/Bernie-2016/ground-control/contributors","subscribers_url":"https://api.github.com/repos/Bernie-2016/ground-control/subscribers","subscription_url":"https://api.github.com/repos/Bernie-2016/ground-control/subscription","commits_url":"https://api.github.com/repos/Bernie-2016/ground-control/commits{/sha}","git_commits_url":"https://api.github.com/repos/Bernie-2016/ground-control/git/commits{/sha}","comments_url":"https://api.github.com/repos/Bernie-2016/ground-control/comments{/number}","issue_comment_url":"https://api.github.com/repos/Bernie-2016/ground-control/issues/comments{/number}","contents_url":"https://api.github.com/repos/Bernie-2016/ground-control/contents/{+path}","compare_url":"https://api.github.com/repos/Bernie-2016/ground-control/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Bernie-2016/ground-control/merges","archive_url":"https://api.github.com/repos/Bernie-2016/ground-control/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Bernie-2016/ground-control/downloads","issues_url":"https://api.github.com/repos/Bernie-2016/ground-control/issues{/number}","pulls_url":"https://api.github.com/repos/Bernie-2016/ground-control/pulls{/number}","milestones_url":"https://api.github.com/repos/Bernie-2016/ground-control/milestones{/number}","notifications_url":"https://api.github.com/repos/Bernie-2016/ground-control/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Bernie-2016/ground-control/labels{/name}","releases_url":"https://api.github.com/repos/Bernie-2016/ground-control/releases{/id}","created_at":"2015-10-12T18:19:33Z","updated_at":"2015-12-10T08:55:04Z","pushed_at":"2015-12-11T00:23:48Z","git_url":"git://github.com/Bernie-2016/ground-control.git","ssh_url":"git@github.com:Bernie-2016/ground-control.git","clone_url":"https://github.com/Bernie-2016/ground-control.git","svn_url":"https://github.com/Bernie-2016/ground-control","homepage":"http://organize.berniesanders.com","size":2652,"stargazers_count":11,"watchers_count":11,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":5,"mirror_url":null,"open_issues_count":79,"forks":5,"open_issues":79,"watchers":11,"default_branch":"master"}},"base":{"label":"Bernie-2016:master","ref":"master","sha":"779dcdb53dd3d547d49f18092f6d5f77b9a40924","user":{"login":"Bernie-2016","id":14190141,"avatar_url":"https://avatars.githubusercontent.com/u/14190141?v=3","gravatar_id":"","url":"https://api.github.com/users/Bernie-2016","html_url":"https://github.com/Bernie-2016","followers_url":"https://api.github.com/users/Bernie-2016/followers","following_url":"https://api.github.com/users/Bernie-2016/following{/other_user}","gists_url":"https://api.github.com/users/Bernie-2016/gists{/gist_id}","starred_url":"https://api.github.com/users/Bernie-2016/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bernie-2016/subscriptions","organizations_url":"https://api.github.com/users/Bernie-2016/orgs","repos_url":"https://api.github.com/users/Bernie-2016/repos","events_url":"https://api.github.com/users/Bernie-2016/events{/privacy}","received_events_url":"https://api.github.com/users/Bernie-2016/received_events","type":"Organization","site_admin":false},"repo":{"id":44125682,"name":"ground-control","full_name":"Bernie-2016/ground-control","owner":{"login":"Bernie-2016","id":14190141,"avatar_url":"https://avatars.githubusercontent.com/u/14190141?v=3","gravatar_id":"","url":"https://api.github.com/users/Bernie-2016","html_url":"https://github.com/Bernie-2016","followers_url":"https://api.github.com/users/Bernie-2016/followers","following_url":"https://api.github.com/users/Bernie-2016/following{/other_user}","gists_url":"https://api.github.com/users/Bernie-2016/gists{/gist_id}","starred_url":"https://api.github.com/users/Bernie-2016/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bernie-2016/subscriptions","organizations_url":"https://api.github.com/users/Bernie-2016/orgs","repos_url":"https://api.github.com/users/Bernie-2016/repos","events_url":"https://api.github.com/users/Bernie-2016/events{/privacy}","received_events_url":"https://api.github.com/users/Bernie-2016/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Bernie-2016/ground-control","description":"Central volunteer and data portal","fork":false,"url":"https://api.github.com/repos/Bernie-2016/ground-control","forks_url":"https://api.github.com/repos/Bernie-2016/ground-control/forks","keys_url":"https://api.github.com/repos/Bernie-2016/ground-control/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Bernie-2016/ground-control/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Bernie-2016/ground-control/teams","hooks_url":"https://api.github.com/repos/Bernie-2016/ground-control/hooks","issue_events_url":"https://api.github.com/repos/Bernie-2016/ground-control/issues/events{/number}","events_url":"https://api.github.com/repos/Bernie-2016/ground-control/events","assignees_url":"https://api.github.com/repos/Bernie-2016/ground-control/assignees{/user}","branches_url":"https://api.github.com/repos/Bernie-2016/ground-control/branches{/branch}","tags_url":"https://api.github.com/repos/Bernie-2016/ground-control/tags","blobs_url":"https://api.github.com/repos/Bernie-2016/ground-control/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Bernie-2016/ground-control/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Bernie-2016/ground-control/git/refs{/sha}","trees_url":"https://api.github.com/repos/Bernie-2016/ground-control/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Bernie-2016/ground-control/statuses/{sha}","languages_url":"https://api.github.com/repos/Bernie-2016/ground-control/languages","stargazers_url":"https://api.github.com/repos/Bernie-2016/ground-control/stargazers","contributors_url":"https://api.github.com/repos/Bernie-2016/ground-control/contributors","subscribers_url":"https://api.github.com/repos/Bernie-2016/ground-control/subscribers","subscription_url":"https://api.github.com/repos/Bernie-2016/ground-control/subscription","commits_url":"https://api.github.com/repos/Bernie-2016/ground-control/commits{/sha}","git_commits_url":"https://api.github.com/repos/Bernie-2016/ground-control/git/commits{/sha}","comments_url":"https://api.github.com/repos/Bernie-2016/ground-control/comments{/number}","issue_comment_url":"https://api.github.com/repos/Bernie-2016/ground-control/issues/comments{/number}","contents_url":"https://api.github.com/repos/Bernie-2016/ground-control/contents/{+path}","compare_url":"https://api.github.com/repos/Bernie-2016/ground-control/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Bernie-2016/ground-control/merges","archive_url":"https://api.github.com/repos/Bernie-2016/ground-control/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Bernie-2016/ground-control/downloads","issues_url":"https://api.github.com/repos/Bernie-2016/ground-control/issues{/number}","pulls_url":"https://api.github.com/repos/Bernie-2016/ground-control/pulls{/number}","milestones_url":"https://api.github.com/repos/Bernie-2016/ground-control/milestones{/number}","notifications_url":"https://api.github.com/repos/Bernie-2016/ground-control/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Bernie-2016/ground-control/labels{/name}","releases_url":"https://api.github.com/repos/Bernie-2016/ground-control/releases{/id}","created_at":"2015-10-12T18:19:33Z","updated_at":"2015-12-10T08:55:04Z","pushed_at":"2015-12-11T00:23:48Z","git_url":"git://github.com/Bernie-2016/ground-control.git","ssh_url":"git@github.com:Bernie-2016/ground-control.git","clone_url":"https://github.com/Bernie-2016/ground-control.git","svn_url":"https://github.com/Bernie-2016/ground-control","homepage":"http://organize.berniesanders.com","size":2652,"stargazers_count":11,"watchers_count":11,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":5,"mirror_url":null,"open_issues_count":79,"forks":5,"open_issues":79,"watchers":11,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Bernie-2016/ground-control/pulls/185"},"html":{"href":"https://github.com/Bernie-2016/ground-control/pull/185"},"issue":{"href":"https://api.github.com/repos/Bernie-2016/ground-control/issues/185"},"comments":{"href":"https://api.github.com/repos/Bernie-2016/ground-control/issues/185/comments"},"review_comments":{"href":"https://api.github.com/repos/Bernie-2016/ground-control/pulls/185/comments"},"review_comment":{"href":"https://api.github.com/repos/Bernie-2016/ground-control/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Bernie-2016/ground-control/pulls/185/commits"},"statuses":{"href":"https://api.github.com/repos/Bernie-2016/ground-control/statuses/ebada19e86c5475903b21ad6fcd9b295a22b366b"}}}}