{"action":"created","issue":{"url":"https://api.github.com/repos/edx/edx-platform/issues/13069","repository_url":"https://api.github.com/repos/edx/edx-platform","labels_url":"https://api.github.com/repos/edx/edx-platform/issues/13069/labels{/name}","comments_url":"https://api.github.com/repos/edx/edx-platform/issues/13069/comments","events_url":"https://api.github.com/repos/edx/edx-platform/issues/13069/events","html_url":"https://github.com/edx/edx-platform/pull/13069","id":166917397,"number":13069,"title":"Use request cache for disabled_xblock_types","user":{"login":"cahrens","id":484484,"avatar_url":"https://avatars.githubusercontent.com/u/484484?v=3","gravatar_id":"","url":"https://api.github.com/users/cahrens","html_url":"https://github.com/cahrens","followers_url":"https://api.github.com/users/cahrens/followers","following_url":"https://api.github.com/users/cahrens/following{/other_user}","gists_url":"https://api.github.com/users/cahrens/gists{/gist_id}","starred_url":"https://api.github.com/users/cahrens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cahrens/subscriptions","organizations_url":"https://api.github.com/users/cahrens/orgs","repos_url":"https://api.github.com/users/cahrens/repos","events_url":"https://api.github.com/users/cahrens/events{/privacy}","received_events_url":"https://api.github.com/users/cahrens/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-07-21T21:04:07Z","updated_at":"2016-07-25T18:05:44Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/13069","html_url":"https://github.com/edx/edx-platform/pull/13069","diff_url":"https://github.com/edx/edx-platform/pull/13069.diff","patch_url":"https://github.com/edx/edx-platform/pull/13069.patch"},"body":"### Description\r\n \r\n[TNL-5002](https://openedx.atlassian.net/browse/TNL-5002)\r\n\r\nIn #12864 I tried to make disabling of XBlocks take effect without restarting the LMS using a Django signal. But since the disabled_xblocks were stored as a variable (not persisted), this didn't work with multiple processes. I have switched to using the request_cache, so the list of disabled xblock names will only be read from the database once per request (on the first get_item call).\r\n\r\n### Sandbox\r\n- [x] You can you disable/enable XBlocks on https://disablexblock.sandbox.edx.org/admin/xblock_django/xblockconfiguration/ (username \"admin\", password \"edx\") and see that the changes takes effect on each request. However, this isn't terribly compelling because the previous solution worked on sandboxes as well....\r\n\r\n### Testing\r\n- [x] safecommit violation code review process-- there are 3 failures in common/lib/xmodule/xmodule/x_module.py on lines I did not touch. I do not wish to take this on as part of this PR.\r\n- [x] Unit, integration, acceptance tests as appropriate. The new code is covered by LMS unit tests and thus does not show in the diff-cover report.\r\n- [x] Performance\r\n\r\n### Reviewers\r\nIf you've been tagged for review, please check your corresponding box once you've given the :+1:.\r\n- [ ] Code review: @ormsbee \r\n- [ ] Code review: @cpennington \r\n\r\nFYI: @efischer19 @ehteshamkafeel \r\n\r\n### Post-review\r\n- [ ] Squash commits\r\n\r\n\r\n\r\nSandbox: https://disablexblock.sandbox.edx.org/admin/xblock_django/xblockconfiguration/"},"comment":{"url":"https://api.github.com/repos/edx/edx-platform/issues/comments/235033888","html_url":"https://github.com/edx/edx-platform/pull/13069#issuecomment-235033888","issue_url":"https://api.github.com/repos/edx/edx-platform/issues/13069","id":235033888,"user":{"login":"ormsbee","id":41625,"avatar_url":"https://avatars.githubusercontent.com/u/41625?v=3","gravatar_id":"","url":"https://api.github.com/users/ormsbee","html_url":"https://github.com/ormsbee","followers_url":"https://api.github.com/users/ormsbee/followers","following_url":"https://api.github.com/users/ormsbee/following{/other_user}","gists_url":"https://api.github.com/users/ormsbee/gists{/gist_id}","starred_url":"https://api.github.com/users/ormsbee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ormsbee/subscriptions","organizations_url":"https://api.github.com/users/ormsbee/orgs","repos_url":"https://api.github.com/users/ormsbee/repos","events_url":"https://api.github.com/users/ormsbee/events{/privacy}","received_events_url":"https://api.github.com/users/ormsbee/received_events","type":"User","site_admin":false},"created_at":"2016-07-25T18:05:44Z","updated_at":"2016-07-25T18:05:44Z","body":"@cahrens: Done with my pass."}}
{"actor":{"display_login":"ormsbee"}}