{"action":"closed","number":231,"pull_request":{"url":"https://api.github.com/repos/Financial-Times/next-myft-email/pulls/231","id":77116071,"html_url":"https://github.com/Financial-Times/next-myft-email/pull/231","diff_url":"https://github.com/Financial-Times/next-myft-email/pull/231.diff","patch_url":"https://github.com/Financial-Times/next-myft-email/pull/231.patch","issue_url":"https://api.github.com/repos/Financial-Times/next-myft-email/issues/231","number":231,"state":"closed","locked":false,"title":"Refactor get-users function to recursively invoke itself","user":{"login":"phamann","id":80089,"avatar_url":"https://avatars.githubusercontent.com/u/80089?v=3","gravatar_id":"","url":"https://api.github.com/users/phamann","html_url":"https://github.com/phamann","followers_url":"https://api.github.com/users/phamann/followers","following_url":"https://api.github.com/users/phamann/following{/other_user}","gists_url":"https://api.github.com/users/phamann/gists{/gist_id}","starred_url":"https://api.github.com/users/phamann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phamann/subscriptions","organizations_url":"https://api.github.com/users/phamann/orgs","repos_url":"https://api.github.com/users/phamann/repos","events_url":"https://api.github.com/users/phamann/events{/privacy}","received_events_url":"https://api.github.com/users/phamann/received_events","type":"User","site_admin":false},"body":"The `get-users` function is taking longer than 5mins to run on a cold DB cache at 6am. Therefore I've refactored the function to instead of recursively query the DB within a single Lambda request instead recursively invoke itself until all users have been fetched.\r\n\r\nDiff looks scarier than it is 😜 ","created_at":"2016-07-12T13:04:22Z","updated_at":"2016-07-12T13:27:55Z","closed_at":"2016-07-12T13:27:55Z","merged_at":"2016-07-12T13:27:55Z","merge_commit_sha":"8a511580367fedb48c28e2ca8e6b34a8e8ab668c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Financial-Times/next-myft-email/pulls/231/commits","review_comments_url":"https://api.github.com/repos/Financial-Times/next-myft-email/pulls/231/comments","review_comment_url":"https://api.github.com/repos/Financial-Times/next-myft-email/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Financial-Times/next-myft-email/issues/231/comments","statuses_url":"https://api.github.com/repos/Financial-Times/next-myft-email/statuses/5687fb435f9bc3fa2bb278e487932ee132d89769","head":{"label":"Financial-Times:get-users-recurse","ref":"get-users-recurse","sha":"5687fb435f9bc3fa2bb278e487932ee132d89769","user":{"login":"Financial-Times","id":3502508,"avatar_url":"https://avatars.githubusercontent.com/u/3502508?v=3","gravatar_id":"","url":"https://api.github.com/users/Financial-Times","html_url":"https://github.com/Financial-Times","followers_url":"https://api.github.com/users/Financial-Times/followers","following_url":"https://api.github.com/users/Financial-Times/following{/other_user}","gists_url":"https://api.github.com/users/Financial-Times/gists{/gist_id}","starred_url":"https://api.github.com/users/Financial-Times/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Financial-Times/subscriptions","organizations_url":"https://api.github.com/users/Financial-Times/orgs","repos_url":"https://api.github.com/users/Financial-Times/repos","events_url":"https://api.github.com/users/Financial-Times/events{/privacy}","received_events_url":"https://api.github.com/users/Financial-Times/received_events","type":"Organization","site_admin":false},"repo":{"id":56044938,"name":"next-myft-email","full_name":"Financial-Times/next-myft-email","owner":{"login":"Financial-Times","id":3502508,"avatar_url":"https://avatars.githubusercontent.com/u/3502508?v=3","gravatar_id":"","url":"https://api.github.com/users/Financial-Times","html_url":"https://github.com/Financial-Times","followers_url":"https://api.github.com/users/Financial-Times/followers","following_url":"https://api.github.com/users/Financial-Times/following{/other_user}","gists_url":"https://api.github.com/users/Financial-Times/gists{/gist_id}","starred_url":"https://api.github.com/users/Financial-Times/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Financial-Times/subscriptions","organizations_url":"https://api.github.com/users/Financial-Times/orgs","repos_url":"https://api.github.com/users/Financial-Times/repos","events_url":"https://api.github.com/users/Financial-Times/events{/privacy}","received_events_url":"https://api.github.com/users/Financial-Times/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Financial-Times/next-myft-email","description":"Collection of services to generate myFT emails","fork":false,"url":"https://api.github.com/repos/Financial-Times/next-myft-email","forks_url":"https://api.github.com/repos/Financial-Times/next-myft-email/forks","keys_url":"https://api.github.com/repos/Financial-Times/next-myft-email/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Financial-Times/next-myft-email/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Financial-Times/next-myft-email/teams","hooks_url":"https://api.github.com/repos/Financial-Times/next-myft-email/hooks","issue_events_url":"https://api.github.com/repos/Financial-Times/next-myft-email/issues/events{/number}","events_url":"https://api.github.com/repos/Financial-Times/next-myft-email/events","assignees_url":"https://api.github.com/repos/Financial-Times/next-myft-email/assignees{/user}","branches_url":"https://api.github.com/repos/Financial-Times/next-myft-email/branches{/branch}","tags_url":"https://api.github.com/repos/Financial-Times/next-myft-email/tags","blobs_url":"https://api.github.com/repos/Financial-Times/next-myft-email/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Financial-Times/next-myft-email/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Financial-Times/next-myft-email/git/refs{/sha}","trees_url":"https://api.github.com/repos/Financial-Times/next-myft-email/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Financial-Times/next-myft-email/statuses/{sha}","languages_url":"https://api.github.com/repos/Financial-Times/next-myft-email/languages","stargazers_url":"https://api.github.com/repos/Financial-Times/next-myft-email/stargazers","contributors_url":"https://api.github.com/repos/Financial-Times/next-myft-email/contributors","subscribers_url":"https://api.github.com/repos/Financial-Times/next-myft-email/subscribers","subscription_url":"https://api.github.com/repos/Financial-Times/next-myft-email/subscription","commits_url":"https://api.github.com/repos/Financial-Times/next-myft-email/commits{/sha}","git_commits_url":"https://api.github.com/repos/Financial-Times/next-myft-email/git/commits{/sha}","comments_url":"https://api.github.com/repos/Financial-Times/next-myft-email/comments{/number}","issue_comment_url":"https://api.github.com/repos/Financial-Times/next-myft-email/issues/comments{/number}","contents_url":"https://api.github.com/repos/Financial-Times/next-myft-email/contents/{+path}","compare_url":"https://api.github.com/repos/Financial-Times/next-myft-email/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Financial-Times/next-myft-email/merges","archive_url":"https://api.github.com/repos/Financial-Times/next-myft-email/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Financial-Times/next-myft-email/downloads","issues_url":"https://api.github.com/repos/Financial-Times/next-myft-email/issues{/number}","pulls_url":"https://api.github.com/repos/Financial-Times/next-myft-email/pulls{/number}","milestones_url":"https://api.github.com/repos/Financial-Times/next-myft-email/milestones{/number}","notifications_url":"https://api.github.com/repos/Financial-Times/next-myft-email/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Financial-Times/next-myft-email/labels{/name}","releases_url":"https://api.github.com/repos/Financial-Times/next-myft-email/releases{/id}","deployments_url":"https://api.github.com/repos/Financial-Times/next-myft-email/deployments","created_at":"2016-04-12T08:27:08Z","updated_at":"2016-04-12T15:41:48Z","pushed_at":"2016-07-12T13:27:55Z","git_url":"git://github.com/Financial-Times/next-myft-email.git","ssh_url":"git@github.com:Financial-Times/next-myft-email.git","clone_url":"https://github.com/Financial-Times/next-myft-email.git","svn_url":"https://github.com/Financial-Times/next-myft-email","homepage":"","size":822,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"Financial-Times:master","ref":"master","sha":"39c89b881d4b84bbe0823c58c5cdadc0fcb69237","user":{"login":"Financial-Times","id":3502508,"avatar_url":"https://avatars.githubusercontent.com/u/3502508?v=3","gravatar_id":"","url":"https://api.github.com/users/Financial-Times","html_url":"https://github.com/Financial-Times","followers_url":"https://api.github.com/users/Financial-Times/followers","following_url":"https://api.github.com/users/Financial-Times/following{/other_user}","gists_url":"https://api.github.com/users/Financial-Times/gists{/gist_id}","starred_url":"https://api.github.com/users/Financial-Times/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Financial-Times/subscriptions","organizations_url":"https://api.github.com/users/Financial-Times/orgs","repos_url":"https://api.github.com/users/Financial-Times/repos","events_url":"https://api.github.com/users/Financial-Times/events{/privacy}","received_events_url":"https://api.github.com/users/Financial-Times/received_events","type":"Organization","site_admin":false},"repo":{"id":56044938,"name":"next-myft-email","full_name":"Financial-Times/next-myft-email","owner":{"login":"Financial-Times","id":3502508,"avatar_url":"https://avatars.githubusercontent.com/u/3502508?v=3","gravatar_id":"","url":"https://api.github.com/users/Financial-Times","html_url":"https://github.com/Financial-Times","followers_url":"https://api.github.com/users/Financial-Times/followers","following_url":"https://api.github.com/users/Financial-Times/following{/other_user}","gists_url":"https://api.github.com/users/Financial-Times/gists{/gist_id}","starred_url":"https://api.github.com/users/Financial-Times/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Financial-Times/subscriptions","organizations_url":"https://api.github.com/users/Financial-Times/orgs","repos_url":"https://api.github.com/users/Financial-Times/repos","events_url":"https://api.github.com/users/Financial-Times/events{/privacy}","received_events_url":"https://api.github.com/users/Financial-Times/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Financial-Times/next-myft-email","description":"Collection of services to generate myFT emails","fork":false,"url":"https://api.github.com/repos/Financial-Times/next-myft-email","forks_url":"https://api.github.com/repos/Financial-Times/next-myft-email/forks","keys_url":"https://api.github.com/repos/Financial-Times/next-myft-email/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Financial-Times/next-myft-email/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Financial-Times/next-myft-email/teams","hooks_url":"https://api.github.com/repos/Financial-Times/next-myft-email/hooks","issue_events_url":"https://api.github.com/repos/Financial-Times/next-myft-email/issues/events{/number}","events_url":"https://api.github.com/repos/Financial-Times/next-myft-email/events","assignees_url":"https://api.github.com/repos/Financial-Times/next-myft-email/assignees{/user}","branches_url":"https://api.github.com/repos/Financial-Times/next-myft-email/branches{/branch}","tags_url":"https://api.github.com/repos/Financial-Times/next-myft-email/tags","blobs_url":"https://api.github.com/repos/Financial-Times/next-myft-email/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Financial-Times/next-myft-email/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Financial-Times/next-myft-email/git/refs{/sha}","trees_url":"https://api.github.com/repos/Financial-Times/next-myft-email/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Financial-Times/next-myft-email/statuses/{sha}","languages_url":"https://api.github.com/repos/Financial-Times/next-myft-email/languages","stargazers_url":"https://api.github.com/repos/Financial-Times/next-myft-email/stargazers","contributors_url":"https://api.github.com/repos/Financial-Times/next-myft-email/contributors","subscribers_url":"https://api.github.com/repos/Financial-Times/next-myft-email/subscribers","subscription_url":"https://api.github.com/repos/Financial-Times/next-myft-email/subscription","commits_url":"https://api.github.com/repos/Financial-Times/next-myft-email/commits{/sha}","git_commits_url":"https://api.github.com/repos/Financial-Times/next-myft-email/git/commits{/sha}","comments_url":"https://api.github.com/repos/Financial-Times/next-myft-email/comments{/number}","issue_comment_url":"https://api.github.com/repos/Financial-Times/next-myft-email/issues/comments{/number}","contents_url":"https://api.github.com/repos/Financial-Times/next-myft-email/contents/{+path}","compare_url":"https://api.github.com/repos/Financial-Times/next-myft-email/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Financial-Times/next-myft-email/merges","archive_url":"https://api.github.com/repos/Financial-Times/next-myft-email/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Financial-Times/next-myft-email/downloads","issues_url":"https://api.github.com/repos/Financial-Times/next-myft-email/issues{/number}","pulls_url":"https://api.github.com/repos/Financial-Times/next-myft-email/pulls{/number}","milestones_url":"https://api.github.com/repos/Financial-Times/next-myft-email/milestones{/number}","notifications_url":"https://api.github.com/repos/Financial-Times/next-myft-email/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Financial-Times/next-myft-email/labels{/name}","releases_url":"https://api.github.com/repos/Financial-Times/next-myft-email/releases{/id}","deployments_url":"https://api.github.com/repos/Financial-Times/next-myft-email/deployments","created_at":"2016-04-12T08:27:08Z","updated_at":"2016-04-12T15:41:48Z","pushed_at":"2016-07-12T13:27:55Z","git_url":"git://github.com/Financial-Times/next-myft-email.git","ssh_url":"git@github.com:Financial-Times/next-myft-email.git","clone_url":"https://github.com/Financial-Times/next-myft-email.git","svn_url":"https://github.com/Financial-Times/next-myft-email","homepage":"","size":822,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Financial-Times/next-myft-email/pulls/231"},"html":{"href":"https://github.com/Financial-Times/next-myft-email/pull/231"},"issue":{"href":"https://api.github.com/repos/Financial-Times/next-myft-email/issues/231"},"comments":{"href":"https://api.github.com/repos/Financial-Times/next-myft-email/issues/231/comments"},"review_comments":{"href":"https://api.github.com/repos/Financial-Times/next-myft-email/pulls/231/comments"},"review_comment":{"href":"https://api.github.com/repos/Financial-Times/next-myft-email/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Financial-Times/next-myft-email/pulls/231/commits"},"statuses":{"href":"https://api.github.com/repos/Financial-Times/next-myft-email/statuses/5687fb435f9bc3fa2bb278e487932ee132d89769"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"phamann","id":80089,"avatar_url":"https://avatars.githubusercontent.com/u/80089?v=3","gravatar_id":"","url":"https://api.github.com/users/phamann","html_url":"https://github.com/phamann","followers_url":"https://api.github.com/users/phamann/followers","following_url":"https://api.github.com/users/phamann/following{/other_user}","gists_url":"https://api.github.com/users/phamann/gists{/gist_id}","starred_url":"https://api.github.com/users/phamann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phamann/subscriptions","organizations_url":"https://api.github.com/users/phamann/orgs","repos_url":"https://api.github.com/users/phamann/repos","events_url":"https://api.github.com/users/phamann/events{/privacy}","received_events_url":"https://api.github.com/users/phamann/received_events","type":"User","site_admin":false},"comments":2,"review_comments":1,"commits":2,"additions":103,"deletions":91,"changed_files":4}}
{"actor":{"display_login":"phamann"}}