{"action":"created","comment":{"url":"https://api.github.com/repos/learningequality/ka-lite/pulls/comments/38362852","id":38362852,"diff_hunk":"@@ -300,7 +300,8 @@ def get_content_cache(force=False, annotate=False, language=None):\n             CONTENT[language] = content\n             return CONTENT[language]\n         else:\n-            CONTENT[language] = softload_json(settings.CONTENT_FILEPATH, logger=logging.debug, raises=False)\n+            CONTENT[language] = (softload_sqlite_cache(settings.CONTENT_CACHE_FILEPATH) or","path":"kalite/topic_tools/__init__.py","position":14,"original_position":14,"commit_id":"d2f3f1e93a49e3fd12516b97c594f5e2ffee90df","original_commit_id":"d2f3f1e93a49e3fd12516b97c594f5e2ffee90df","user":{"login":"aronasorman","id":191955,"avatar_url":"https://avatars.githubusercontent.com/u/191955?v=3","gravatar_id":"","url":"https://api.github.com/users/aronasorman","html_url":"https://github.com/aronasorman","followers_url":"https://api.github.com/users/aronasorman/followers","following_url":"https://api.github.com/users/aronasorman/following{/other_user}","gists_url":"https://api.github.com/users/aronasorman/gists{/gist_id}","starred_url":"https://api.github.com/users/aronasorman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aronasorman/subscriptions","organizations_url":"https://api.github.com/users/aronasorman/orgs","repos_url":"https://api.github.com/users/aronasorman/repos","events_url":"https://api.github.com/users/aronasorman/events{/privacy}","received_events_url":"https://api.github.com/users/aronasorman/received_events","type":"User","site_admin":false},"body":"Oh, my bad. Looks like it's not duplicated in memory, but writes to the values are stored in a [transaction](https://github.com/piskvorky/sqlitedict/blob/master/sqlitedict.py#L441-L450). So they'll only persist across reboots when we call `.commit()` (not `.save`). Only a copy of the value is stored in memory when there's a reference to it somewhere.\r\n\r\nSince it uses transactions though, I'm surprised it's working properly, given that python's sqlite3 module is somewhat buggy with transactions.","created_at":"2015-08-31T21:38:26Z","updated_at":"2015-08-31T21:38:26Z","html_url":"https://github.com/learningequality/ka-lite/pull/4306#discussion_r38362852","pull_request_url":"https://api.github.com/repos/learningequality/ka-lite/pulls/4306","_links":{"self":{"href":"https://api.github.com/repos/learningequality/ka-lite/pulls/comments/38362852"},"html":{"href":"https://github.com/learningequality/ka-lite/pull/4306#discussion_r38362852"},"pull_request":{"href":"https://api.github.com/repos/learningequality/ka-lite/pulls/4306"}}},"pull_request":{"url":"https://api.github.com/repos/learningequality/ka-lite/pulls/4306","id":43648517,"html_url":"https://github.com/learningequality/ka-lite/pull/4306","diff_url":"https://github.com/learningequality/ka-lite/pull/4306.diff","patch_url":"https://github.com/learningequality/ka-lite/pull/4306.patch","issue_url":"https://api.github.com/repos/learningequality/ka-lite/issues/4306","number":4306,"state":"open","locked":false,"title":"Use SQLiteDict for the content cache.","user":{"login":"aronasorman","id":191955,"avatar_url":"https://avatars.githubusercontent.com/u/191955?v=3","gravatar_id":"","url":"https://api.github.com/users/aronasorman","html_url":"https://github.com/aronasorman","followers_url":"https://api.github.com/users/aronasorman/followers","following_url":"https://api.github.com/users/aronasorman/following{/other_user}","gists_url":"https://api.github.com/users/aronasorman/gists{/gist_id}","starred_url":"https://api.github.com/users/aronasorman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aronasorman/subscriptions","organizations_url":"https://api.github.com/users/aronasorman/orgs","repos_url":"https://api.github.com/users/aronasorman/repos","events_url":"https://api.github.com/users/aronasorman/events{/privacy}","received_events_url":"https://api.github.com/users/aronasorman/received_events","type":"User","site_admin":false},"body":"For memory constrained systems such as Android and the SanDisk, admins may have the option of running the `create_content_db` which will generate a `contents.sqlite` option. This has some substantial memory improvements as shown [in this gist](https://gist.github.com/aronasorman/bceac4036dfc8e152f35).\r\n\r\nBehaviour wise it should be identical to the old json content dict. Implementation wise, we generate an SQLite file that whose interface is similar to a dictionary.","created_at":"2015-08-28T16:51:55Z","updated_at":"2015-08-31T21:38:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f3df4bbae109a28c18ef8ff20a0e75c3ef308e50","assignee":{"login":"rtibbles","id":1680573,"avatar_url":"https://avatars.githubusercontent.com/u/1680573?v=3","gravatar_id":"","url":"https://api.github.com/users/rtibbles","html_url":"https://github.com/rtibbles","followers_url":"https://api.github.com/users/rtibbles/followers","following_url":"https://api.github.com/users/rtibbles/following{/other_user}","gists_url":"https://api.github.com/users/rtibbles/gists{/gist_id}","starred_url":"https://api.github.com/users/rtibbles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rtibbles/subscriptions","organizations_url":"https://api.github.com/users/rtibbles/orgs","repos_url":"https://api.github.com/users/rtibbles/repos","events_url":"https://api.github.com/users/rtibbles/events{/privacy}","received_events_url":"https://api.github.com/users/rtibbles/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/learningequality/ka-lite/milestones/48","html_url":"https://github.com/learningequality/ka-lite/milestones/0.15.0","labels_url":"https://api.github.com/repos/learningequality/ka-lite/milestones/48/labels","id":1028214,"number":48,"title":"0.15.0","description":"","creator":{"login":"aronasorman","id":191955,"avatar_url":"https://avatars.githubusercontent.com/u/191955?v=3","gravatar_id":"","url":"https://api.github.com/users/aronasorman","html_url":"https://github.com/aronasorman","followers_url":"https://api.github.com/users/aronasorman/followers","following_url":"https://api.github.com/users/aronasorman/following{/other_user}","gists_url":"https://api.github.com/users/aronasorman/gists{/gist_id}","starred_url":"https://api.github.com/users/aronasorman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aronasorman/subscriptions","organizations_url":"https://api.github.com/users/aronasorman/orgs","repos_url":"https://api.github.com/users/aronasorman/repos","events_url":"https://api.github.com/users/aronasorman/events{/privacy}","received_events_url":"https://api.github.com/users/aronasorman/received_events","type":"User","site_admin":false},"open_issues":151,"closed_issues":58,"state":"open","created_at":"2015-03-18T22:06:13Z","updated_at":"2015-08-31T19:02:50Z","due_on":"2015-09-30T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/learningequality/ka-lite/pulls/4306/commits","review_comments_url":"https://api.github.com/repos/learningequality/ka-lite/pulls/4306/comments","review_comment_url":"https://api.github.com/repos/learningequality/ka-lite/pulls/comments{/number}","comments_url":"https://api.github.com/repos/learningequality/ka-lite/issues/4306/comments","statuses_url":"https://api.github.com/repos/learningequality/ka-lite/statuses/d2f3f1e93a49e3fd12516b97c594f5e2ffee90df","head":{"label":"aronasorman:optimizations","ref":"optimizations","sha":"d2f3f1e93a49e3fd12516b97c594f5e2ffee90df","user":{"login":"aronasorman","id":191955,"avatar_url":"https://avatars.githubusercontent.com/u/191955?v=3","gravatar_id":"","url":"https://api.github.com/users/aronasorman","html_url":"https://github.com/aronasorman","followers_url":"https://api.github.com/users/aronasorman/followers","following_url":"https://api.github.com/users/aronasorman/following{/other_user}","gists_url":"https://api.github.com/users/aronasorman/gists{/gist_id}","starred_url":"https://api.github.com/users/aronasorman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aronasorman/subscriptions","organizations_url":"https://api.github.com/users/aronasorman/orgs","repos_url":"https://api.github.com/users/aronasorman/repos","events_url":"https://api.github.com/users/aronasorman/events{/privacy}","received_events_url":"https://api.github.com/users/aronasorman/received_events","type":"User","site_admin":false},"repo":{"id":10856122,"name":"ka-lite","full_name":"aronasorman/ka-lite","owner":{"login":"aronasorman","id":191955,"avatar_url":"https://avatars.githubusercontent.com/u/191955?v=3","gravatar_id":"","url":"https://api.github.com/users/aronasorman","html_url":"https://github.com/aronasorman","followers_url":"https://api.github.com/users/aronasorman/followers","following_url":"https://api.github.com/users/aronasorman/following{/other_user}","gists_url":"https://api.github.com/users/aronasorman/gists{/gist_id}","starred_url":"https://api.github.com/users/aronasorman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aronasorman/subscriptions","organizations_url":"https://api.github.com/users/aronasorman/orgs","repos_url":"https://api.github.com/users/aronasorman/repos","events_url":"https://api.github.com/users/aronasorman/events{/privacy}","received_events_url":"https://api.github.com/users/aronasorman/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aronasorman/ka-lite","description":"Khan Academy Lite: lightweight web server for serving core Khan Academy content (videos and exercises) without needing internet connectivity","fork":true,"url":"https://api.github.com/repos/aronasorman/ka-lite","forks_url":"https://api.github.com/repos/aronasorman/ka-lite/forks","keys_url":"https://api.github.com/repos/aronasorman/ka-lite/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aronasorman/ka-lite/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aronasorman/ka-lite/teams","hooks_url":"https://api.github.com/repos/aronasorman/ka-lite/hooks","issue_events_url":"https://api.github.com/repos/aronasorman/ka-lite/issues/events{/number}","events_url":"https://api.github.com/repos/aronasorman/ka-lite/events","assignees_url":"https://api.github.com/repos/aronasorman/ka-lite/assignees{/user}","branches_url":"https://api.github.com/repos/aronasorman/ka-lite/branches{/branch}","tags_url":"https://api.github.com/repos/aronasorman/ka-lite/tags","blobs_url":"https://api.github.com/repos/aronasorman/ka-lite/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aronasorman/ka-lite/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aronasorman/ka-lite/git/refs{/sha}","trees_url":"https://api.github.com/repos/aronasorman/ka-lite/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aronasorman/ka-lite/statuses/{sha}","languages_url":"https://api.github.com/repos/aronasorman/ka-lite/languages","stargazers_url":"https://api.github.com/repos/aronasorman/ka-lite/stargazers","contributors_url":"https://api.github.com/repos/aronasorman/ka-lite/contributors","subscribers_url":"https://api.github.com/repos/aronasorman/ka-lite/subscribers","subscription_url":"https://api.github.com/repos/aronasorman/ka-lite/subscription","commits_url":"https://api.github.com/repos/aronasorman/ka-lite/commits{/sha}","git_commits_url":"https://api.github.com/repos/aronasorman/ka-lite/git/commits{/sha}","comments_url":"https://api.github.com/repos/aronasorman/ka-lite/comments{/number}","issue_comment_url":"https://api.github.com/repos/aronasorman/ka-lite/issues/comments{/number}","contents_url":"https://api.github.com/repos/aronasorman/ka-lite/contents/{+path}","compare_url":"https://api.github.com/repos/aronasorman/ka-lite/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aronasorman/ka-lite/merges","archive_url":"https://api.github.com/repos/aronasorman/ka-lite/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aronasorman/ka-lite/downloads","issues_url":"https://api.github.com/repos/aronasorman/ka-lite/issues{/number}","pulls_url":"https://api.github.com/repos/aronasorman/ka-lite/pulls{/number}","milestones_url":"https://api.github.com/repos/aronasorman/ka-lite/milestones{/number}","notifications_url":"https://api.github.com/repos/aronasorman/ka-lite/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aronasorman/ka-lite/labels{/name}","releases_url":"https://api.github.com/repos/aronasorman/ka-lite/releases{/id}","created_at":"2013-06-22T00:50:51Z","updated_at":"2015-01-30T22:57:15Z","pushed_at":"2015-08-28T21:04:47Z","git_url":"git://github.com/aronasorman/ka-lite.git","ssh_url":"git@github.com:aronasorman/ka-lite.git","clone_url":"https://github.com/aronasorman/ka-lite.git","svn_url":"https://github.com/aronasorman/ka-lite","homepage":"http://kalite.learningequality.org/","size":172453,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":3,"forks":2,"open_issues":3,"watchers":0,"default_branch":"develop"}},"base":{"label":"learningequality:develop","ref":"develop","sha":"f732804f26384e3633f5f65c6feddb16c412ee50","user":{"login":"learningequality","id":3926525,"avatar_url":"https://avatars.githubusercontent.com/u/3926525?v=3","gravatar_id":"","url":"https://api.github.com/users/learningequality","html_url":"https://github.com/learningequality","followers_url":"https://api.github.com/users/learningequality/followers","following_url":"https://api.github.com/users/learningequality/following{/other_user}","gists_url":"https://api.github.com/users/learningequality/gists{/gist_id}","starred_url":"https://api.github.com/users/learningequality/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/learningequality/subscriptions","organizations_url":"https://api.github.com/users/learningequality/orgs","repos_url":"https://api.github.com/users/learningequality/repos","events_url":"https://api.github.com/users/learningequality/events{/privacy}","received_events_url":"https://api.github.com/users/learningequality/received_events","type":"Organization","site_admin":false},"repo":{"id":5741125,"name":"ka-lite","full_name":"learningequality/ka-lite","owner":{"login":"learningequality","id":3926525,"avatar_url":"https://avatars.githubusercontent.com/u/3926525?v=3","gravatar_id":"","url":"https://api.github.com/users/learningequality","html_url":"https://github.com/learningequality","followers_url":"https://api.github.com/users/learningequality/followers","following_url":"https://api.github.com/users/learningequality/following{/other_user}","gists_url":"https://api.github.com/users/learningequality/gists{/gist_id}","starred_url":"https://api.github.com/users/learningequality/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/learningequality/subscriptions","organizations_url":"https://api.github.com/users/learningequality/orgs","repos_url":"https://api.github.com/users/learningequality/repos","events_url":"https://api.github.com/users/learningequality/events{/privacy}","received_events_url":"https://api.github.com/users/learningequality/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/learningequality/ka-lite","description":"KA Lite: lightweight web server for serving core Khan Academy content (videos and exercises) without needing internet connectivity","fork":false,"url":"https://api.github.com/repos/learningequality/ka-lite","forks_url":"https://api.github.com/repos/learningequality/ka-lite/forks","keys_url":"https://api.github.com/repos/learningequality/ka-lite/keys{/key_id}","collaborators_url":"https://api.github.com/repos/learningequality/ka-lite/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/learningequality/ka-lite/teams","hooks_url":"https://api.github.com/repos/learningequality/ka-lite/hooks","issue_events_url":"https://api.github.com/repos/learningequality/ka-lite/issues/events{/number}","events_url":"https://api.github.com/repos/learningequality/ka-lite/events","assignees_url":"https://api.github.com/repos/learningequality/ka-lite/assignees{/user}","branches_url":"https://api.github.com/repos/learningequality/ka-lite/branches{/branch}","tags_url":"https://api.github.com/repos/learningequality/ka-lite/tags","blobs_url":"https://api.github.com/repos/learningequality/ka-lite/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/learningequality/ka-lite/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/learningequality/ka-lite/git/refs{/sha}","trees_url":"https://api.github.com/repos/learningequality/ka-lite/git/trees{/sha}","statuses_url":"https://api.github.com/repos/learningequality/ka-lite/statuses/{sha}","languages_url":"https://api.github.com/repos/learningequality/ka-lite/languages","stargazers_url":"https://api.github.com/repos/learningequality/ka-lite/stargazers","contributors_url":"https://api.github.com/repos/learningequality/ka-lite/contributors","subscribers_url":"https://api.github.com/repos/learningequality/ka-lite/subscribers","subscription_url":"https://api.github.com/repos/learningequality/ka-lite/subscription","commits_url":"https://api.github.com/repos/learningequality/ka-lite/commits{/sha}","git_commits_url":"https://api.github.com/repos/learningequality/ka-lite/git/commits{/sha}","comments_url":"https://api.github.com/repos/learningequality/ka-lite/comments{/number}","issue_comment_url":"https://api.github.com/repos/learningequality/ka-lite/issues/comments{/number}","contents_url":"https://api.github.com/repos/learningequality/ka-lite/contents/{+path}","compare_url":"https://api.github.com/repos/learningequality/ka-lite/compare/{base}...{head}","merges_url":"https://api.github.com/repos/learningequality/ka-lite/merges","archive_url":"https://api.github.com/repos/learningequality/ka-lite/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/learningequality/ka-lite/downloads","issues_url":"https://api.github.com/repos/learningequality/ka-lite/issues{/number}","pulls_url":"https://api.github.com/repos/learningequality/ka-lite/pulls{/number}","milestones_url":"https://api.github.com/repos/learningequality/ka-lite/milestones{/number}","notifications_url":"https://api.github.com/repos/learningequality/ka-lite/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/learningequality/ka-lite/labels{/name}","releases_url":"https://api.github.com/repos/learningequality/ka-lite/releases{/id}","created_at":"2012-09-09T20:01:40Z","updated_at":"2015-08-28T13:21:19Z","pushed_at":"2015-08-31T21:23:34Z","git_url":"git://github.com/learningequality/ka-lite.git","ssh_url":"git@github.com:learningequality/ka-lite.git","clone_url":"https://github.com/learningequality/ka-lite.git","svn_url":"https://github.com/learningequality/ka-lite","homepage":"https://learningequality.org/ka-lite/","size":238040,"stargazers_count":230,"watchers_count":230,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":253,"mirror_url":null,"open_issues_count":296,"forks":253,"open_issues":296,"watchers":230,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/learningequality/ka-lite/pulls/4306"},"html":{"href":"https://github.com/learningequality/ka-lite/pull/4306"},"issue":{"href":"https://api.github.com/repos/learningequality/ka-lite/issues/4306"},"comments":{"href":"https://api.github.com/repos/learningequality/ka-lite/issues/4306/comments"},"review_comments":{"href":"https://api.github.com/repos/learningequality/ka-lite/pulls/4306/comments"},"review_comment":{"href":"https://api.github.com/repos/learningequality/ka-lite/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/learningequality/ka-lite/pulls/4306/commits"},"statuses":{"href":"https://api.github.com/repos/learningequality/ka-lite/statuses/d2f3f1e93a49e3fd12516b97c594f5e2ffee90df"}}}}