{"action":"created","comment":{"url":"https://api.github.com/repos/decred/dcrdata/pulls/comments/215365841","pull_request_review_id":152613843,"id":215365841,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNTM2NTg0MQ==","diff_hunk":"@@ -188,6 +188,9 @@ func (wsh *WebsocketHub) run() {\n \t\t\tswitch hubSignal {\n \t\t\tcase sigNewBlock:\n \t\t\t\tlog.Infof(\"Signaling new block to %d websocket clients.\", len(wsh.clients))\n+\n+\t\t\t\t// drops the outdated data in the ticketpool cache.\n+\t\t\t\tcleanUpTicketPoolData()","path":"explorer/websocket.go","position":6,"original_position":6,"commit_id":"b37eec279a40c5aea38321658276d3b7d7a54b05","original_commit_id":"b37eec279a40c5aea38321658276d3b7d7a54b05","user":{"login":"dmigwi","id":22055953,"node_id":"MDQ6VXNlcjIyMDU1OTUz","avatar_url":"https://avatars1.githubusercontent.com/u/22055953?v=4","gravatar_id":"","url":"https://api.github.com/users/dmigwi","html_url":"https://github.com/dmigwi","followers_url":"https://api.github.com/users/dmigwi/followers","following_url":"https://api.github.com/users/dmigwi/following{/other_user}","gists_url":"https://api.github.com/users/dmigwi/gists{/gist_id}","starred_url":"https://api.github.com/users/dmigwi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmigwi/subscriptions","organizations_url":"https://api.github.com/users/dmigwi/orgs","repos_url":"https://api.github.com/users/dmigwi/repos","events_url":"https://api.github.com/users/dmigwi/events{/privacy}","received_events_url":"https://api.github.com/users/dmigwi/received_events","type":"User","site_admin":false},"body":"This makes lots of sense now. It allows the possibility of scaling horizontally instead of vertically. I.e. we don't overburden a single thread with too much work but we create several threads to share the workload.","created_at":"2018-09-05T17:47:10Z","updated_at":"2018-09-05T17:47:10Z","html_url":"https://github.com/decred/dcrdata/pull/664#discussion_r215365841","pull_request_url":"https://api.github.com/repos/decred/dcrdata/pulls/664","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/decred/dcrdata/pulls/comments/215365841"},"html":{"href":"https://github.com/decred/dcrdata/pull/664#discussion_r215365841"},"pull_request":{"href":"https://api.github.com/repos/decred/dcrdata/pulls/664"}},"in_reply_to_id":215292536},"pull_request":{"url":"https://api.github.com/repos/decred/dcrdata/pulls/664","id":213143120,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEzMTQzMTIw","html_url":"https://github.com/decred/dcrdata/pull/664","diff_url":"https://github.com/decred/dcrdata/pull/664.diff","patch_url":"https://github.com/decred/dcrdata/pull/664.patch","issue_url":"https://api.github.com/repos/decred/dcrdata/issues/664","number":664,"state":"open","locked":false,"title":"Cache the ticket pool data","user":{"login":"dmigwi","id":22055953,"node_id":"MDQ6VXNlcjIyMDU1OTUz","avatar_url":"https://avatars1.githubusercontent.com/u/22055953?v=4","gravatar_id":"","url":"https://api.github.com/users/dmigwi","html_url":"https://github.com/dmigwi","followers_url":"https://api.github.com/users/dmigwi/followers","following_url":"https://api.github.com/users/dmigwi/following{/other_user}","gists_url":"https://api.github.com/users/dmigwi/gists{/gist_id}","starred_url":"https://api.github.com/users/dmigwi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmigwi/subscriptions","organizations_url":"https://api.github.com/users/dmigwi/orgs","repos_url":"https://api.github.com/users/dmigwi/repos","events_url":"https://api.github.com/users/dmigwi/events{/privacy}","received_events_url":"https://api.github.com/users/dmigwi/received_events","type":"User","site_admin":false},"body":"This is a fix to the data racing issue/handling multiple requests fetching similar data, we had initially with https://github.com/decred/dcrdata/pull/542 `tpEvent` implementation\r\n\r\nData is cached till updated data (new block) is available.\r\n\r\n<img width=\"1154\" alt=\"screen shot 2018-09-05 at 04 03 03\" src=\"https://user-images.githubusercontent.com/22055953/45065239-bca5ec00-b0c0-11e8-82dd-53f1c68fbb2f.png\">\r\n\r\nFrom the above screenshot the first request is a bit slow then consecutive requests become super fast since no db connection is necessary then.","created_at":"2018-09-05T01:10:43Z","updated_at":"2018-09-05T17:47:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"27f6ec5e974372c75cac7e57891cd5fe6328596b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/decred/dcrdata/pulls/664/commits","review_comments_url":"https://api.github.com/repos/decred/dcrdata/pulls/664/comments","review_comment_url":"https://api.github.com/repos/decred/dcrdata/pulls/comments{/number}","comments_url":"https://api.github.com/repos/decred/dcrdata/issues/664/comments","statuses_url":"https://api.github.com/repos/decred/dcrdata/statuses/b37eec279a40c5aea38321658276d3b7d7a54b05","head":{"label":"dmigwi:ticketpool-websocket-requests-cacheing","ref":"ticketpool-websocket-requests-cacheing","sha":"b37eec279a40c5aea38321658276d3b7d7a54b05","user":{"login":"dmigwi","id":22055953,"node_id":"MDQ6VXNlcjIyMDU1OTUz","avatar_url":"https://avatars1.githubusercontent.com/u/22055953?v=4","gravatar_id":"","url":"https://api.github.com/users/dmigwi","html_url":"https://github.com/dmigwi","followers_url":"https://api.github.com/users/dmigwi/followers","following_url":"https://api.github.com/users/dmigwi/following{/other_user}","gists_url":"https://api.github.com/users/dmigwi/gists{/gist_id}","starred_url":"https://api.github.com/users/dmigwi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmigwi/subscriptions","organizations_url":"https://api.github.com/users/dmigwi/orgs","repos_url":"https://api.github.com/users/dmigwi/repos","events_url":"https://api.github.com/users/dmigwi/events{/privacy}","received_events_url":"https://api.github.com/users/dmigwi/received_events","type":"User","site_admin":false},"repo":{"id":128812275,"node_id":"MDEwOlJlcG9zaXRvcnkxMjg4MTIyNzU=","name":"dcrdata","full_name":"dmigwi/dcrdata","owner":{"login":"dmigwi","id":22055953,"node_id":"MDQ6VXNlcjIyMDU1OTUz","avatar_url":"https://avatars1.githubusercontent.com/u/22055953?v=4","gravatar_id":"","url":"https://api.github.com/users/dmigwi","html_url":"https://github.com/dmigwi","followers_url":"https://api.github.com/users/dmigwi/followers","following_url":"https://api.github.com/users/dmigwi/following{/other_user}","gists_url":"https://api.github.com/users/dmigwi/gists{/gist_id}","starred_url":"https://api.github.com/users/dmigwi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmigwi/subscriptions","organizations_url":"https://api.github.com/users/dmigwi/orgs","repos_url":"https://api.github.com/users/dmigwi/repos","events_url":"https://api.github.com/users/dmigwi/events{/privacy}","received_events_url":"https://api.github.com/users/dmigwi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dmigwi/dcrdata","description":"Decred block explorer, with packages and apps for data collection and storage. Written in Go.","fork":true,"url":"https://api.github.com/repos/dmigwi/dcrdata","forks_url":"https://api.github.com/repos/dmigwi/dcrdata/forks","keys_url":"https://api.github.com/repos/dmigwi/dcrdata/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dmigwi/dcrdata/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dmigwi/dcrdata/teams","hooks_url":"https://api.github.com/repos/dmigwi/dcrdata/hooks","issue_events_url":"https://api.github.com/repos/dmigwi/dcrdata/issues/events{/number}","events_url":"https://api.github.com/repos/dmigwi/dcrdata/events","assignees_url":"https://api.github.com/repos/dmigwi/dcrdata/assignees{/user}","branches_url":"https://api.github.com/repos/dmigwi/dcrdata/branches{/branch}","tags_url":"https://api.github.com/repos/dmigwi/dcrdata/tags","blobs_url":"https://api.github.com/repos/dmigwi/dcrdata/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dmigwi/dcrdata/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dmigwi/dcrdata/git/refs{/sha}","trees_url":"https://api.github.com/repos/dmigwi/dcrdata/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dmigwi/dcrdata/statuses/{sha}","languages_url":"https://api.github.com/repos/dmigwi/dcrdata/languages","stargazers_url":"https://api.github.com/repos/dmigwi/dcrdata/stargazers","contributors_url":"https://api.github.com/repos/dmigwi/dcrdata/contributors","subscribers_url":"https://api.github.com/repos/dmigwi/dcrdata/subscribers","subscription_url":"https://api.github.com/repos/dmigwi/dcrdata/subscription","commits_url":"https://api.github.com/repos/dmigwi/dcrdata/commits{/sha}","git_commits_url":"https://api.github.com/repos/dmigwi/dcrdata/git/commits{/sha}","comments_url":"https://api.github.com/repos/dmigwi/dcrdata/comments{/number}","issue_comment_url":"https://api.github.com/repos/dmigwi/dcrdata/issues/comments{/number}","contents_url":"https://api.github.com/repos/dmigwi/dcrdata/contents/{+path}","compare_url":"https://api.github.com/repos/dmigwi/dcrdata/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dmigwi/dcrdata/merges","archive_url":"https://api.github.com/repos/dmigwi/dcrdata/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dmigwi/dcrdata/downloads","issues_url":"https://api.github.com/repos/dmigwi/dcrdata/issues{/number}","pulls_url":"https://api.github.com/repos/dmigwi/dcrdata/pulls{/number}","milestones_url":"https://api.github.com/repos/dmigwi/dcrdata/milestones{/number}","notifications_url":"https://api.github.com/repos/dmigwi/dcrdata/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dmigwi/dcrdata/labels{/name}","releases_url":"https://api.github.com/repos/dmigwi/dcrdata/releases{/id}","deployments_url":"https://api.github.com/repos/dmigwi/dcrdata/deployments","created_at":"2018-04-09T17:52:54Z","updated_at":"2018-09-04T16:35:20Z","pushed_at":"2018-09-05T01:54:09Z","git_url":"git://github.com/dmigwi/dcrdata.git","ssh_url":"git@github.com:dmigwi/dcrdata.git","clone_url":"https://github.com/dmigwi/dcrdata.git","svn_url":"https://github.com/dmigwi/dcrdata","homepage":"https://explorer.dcrdata.org/","size":8313,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"isc","name":"ISC License","spdx_id":"ISC","url":"https://api.github.com/licenses/isc","node_id":"MDc6TGljZW5zZTEw"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"decred:master","ref":"master","sha":"40e118b6c52b4228b85447bc412f9b4123da1cbc","user":{"login":"decred","id":16297194,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Mjk3MTk0","avatar_url":"https://avatars3.githubusercontent.com/u/16297194?v=4","gravatar_id":"","url":"https://api.github.com/users/decred","html_url":"https://github.com/decred","followers_url":"https://api.github.com/users/decred/followers","following_url":"https://api.github.com/users/decred/following{/other_user}","gists_url":"https://api.github.com/users/decred/gists{/gist_id}","starred_url":"https://api.github.com/users/decred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/decred/subscriptions","organizations_url":"https://api.github.com/users/decred/orgs","repos_url":"https://api.github.com/users/decred/repos","events_url":"https://api.github.com/users/decred/events{/privacy}","received_events_url":"https://api.github.com/users/decred/received_events","type":"Organization","site_admin":false},"repo":{"id":82826361,"node_id":"MDEwOlJlcG9zaXRvcnk4MjgyNjM2MQ==","name":"dcrdata","full_name":"decred/dcrdata","owner":{"login":"decred","id":16297194,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2Mjk3MTk0","avatar_url":"https://avatars3.githubusercontent.com/u/16297194?v=4","gravatar_id":"","url":"https://api.github.com/users/decred","html_url":"https://github.com/decred","followers_url":"https://api.github.com/users/decred/followers","following_url":"https://api.github.com/users/decred/following{/other_user}","gists_url":"https://api.github.com/users/decred/gists{/gist_id}","starred_url":"https://api.github.com/users/decred/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/decred/subscriptions","organizations_url":"https://api.github.com/users/decred/orgs","repos_url":"https://api.github.com/users/decred/repos","events_url":"https://api.github.com/users/decred/events{/privacy}","received_events_url":"https://api.github.com/users/decred/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/decred/dcrdata","description":"Decred block explorer, with packages and apps for data collection and storage. Written in Go.","fork":false,"url":"https://api.github.com/repos/decred/dcrdata","forks_url":"https://api.github.com/repos/decred/dcrdata/forks","keys_url":"https://api.github.com/repos/decred/dcrdata/keys{/key_id}","collaborators_url":"https://api.github.com/repos/decred/dcrdata/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/decred/dcrdata/teams","hooks_url":"https://api.github.com/repos/decred/dcrdata/hooks","issue_events_url":"https://api.github.com/repos/decred/dcrdata/issues/events{/number}","events_url":"https://api.github.com/repos/decred/dcrdata/events","assignees_url":"https://api.github.com/repos/decred/dcrdata/assignees{/user}","branches_url":"https://api.github.com/repos/decred/dcrdata/branches{/branch}","tags_url":"https://api.github.com/repos/decred/dcrdata/tags","blobs_url":"https://api.github.com/repos/decred/dcrdata/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/decred/dcrdata/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/decred/dcrdata/git/refs{/sha}","trees_url":"https://api.github.com/repos/decred/dcrdata/git/trees{/sha}","statuses_url":"https://api.github.com/repos/decred/dcrdata/statuses/{sha}","languages_url":"https://api.github.com/repos/decred/dcrdata/languages","stargazers_url":"https://api.github.com/repos/decred/dcrdata/stargazers","contributors_url":"https://api.github.com/repos/decred/dcrdata/contributors","subscribers_url":"https://api.github.com/repos/decred/dcrdata/subscribers","subscription_url":"https://api.github.com/repos/decred/dcrdata/subscription","commits_url":"https://api.github.com/repos/decred/dcrdata/commits{/sha}","git_commits_url":"https://api.github.com/repos/decred/dcrdata/git/commits{/sha}","comments_url":"https://api.github.com/repos/decred/dcrdata/comments{/number}","issue_comment_url":"https://api.github.com/repos/decred/dcrdata/issues/comments{/number}","contents_url":"https://api.github.com/repos/decred/dcrdata/contents/{+path}","compare_url":"https://api.github.com/repos/decred/dcrdata/compare/{base}...{head}","merges_url":"https://api.github.com/repos/decred/dcrdata/merges","archive_url":"https://api.github.com/repos/decred/dcrdata/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/decred/dcrdata/downloads","issues_url":"https://api.github.com/repos/decred/dcrdata/issues{/number}","pulls_url":"https://api.github.com/repos/decred/dcrdata/pulls{/number}","milestones_url":"https://api.github.com/repos/decred/dcrdata/milestones{/number}","notifications_url":"https://api.github.com/repos/decred/dcrdata/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/decred/dcrdata/labels{/name}","releases_url":"https://api.github.com/repos/decred/dcrdata/releases{/id}","deployments_url":"https://api.github.com/repos/decred/dcrdata/deployments","created_at":"2017-02-22T16:24:53Z","updated_at":"2018-09-05T02:31:52Z","pushed_at":"2018-09-05T11:26:23Z","git_url":"git://github.com/decred/dcrdata.git","ssh_url":"git@github.com:decred/dcrdata.git","clone_url":"https://github.com/decred/dcrdata.git","svn_url":"https://github.com/decred/dcrdata","homepage":"https://explorer.dcrdata.org/","size":8233,"stargazers_count":51,"watchers_count":51,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":69,"mirror_url":null,"archived":false,"open_issues_count":85,"license":{"key":"isc","name":"ISC License","spdx_id":"ISC","url":"https://api.github.com/licenses/isc","node_id":"MDc6TGljZW5zZTEw"},"forks":69,"open_issues":85,"watchers":51,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/decred/dcrdata/pulls/664"},"html":{"href":"https://github.com/decred/dcrdata/pull/664"},"issue":{"href":"https://api.github.com/repos/decred/dcrdata/issues/664"},"comments":{"href":"https://api.github.com/repos/decred/dcrdata/issues/664/comments"},"review_comments":{"href":"https://api.github.com/repos/decred/dcrdata/pulls/664/comments"},"review_comment":{"href":"https://api.github.com/repos/decred/dcrdata/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/decred/dcrdata/pulls/664/commits"},"statuses":{"href":"https://api.github.com/repos/decred/dcrdata/statuses/b37eec279a40c5aea38321658276d3b7d7a54b05"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"dmigwi"}}