-
Notifications
You must be signed in to change notification settings - Fork 303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Write cache data in user space #4109 #4122
Write cache data in user space #4109 #4122
Conversation
c7cbefd
to
c69812c
Compare
c69812c
to
3551e55
Compare
a652420
to
10fe718
Compare
Now it resolves #4109 ! The topics cache was written wrongly, works after renaming |
def cache_file_path(basename): | ||
"""Consistently return path for a cache filename. This path has to be | ||
writable for the user running kalite.""" | ||
assert "/" not in basename, "Please use a valid filename" |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
if language == "en": # English-language exercises live in application space, translations in user space | ||
|
||
# English-language exercises live in application space, translations in user space | ||
if language == "en": |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -266,16 +287,22 @@ def get_content_cache(force=False, annotate=False, language=None): | |||
|
|||
if CONTENT is None: | |||
CONTENT = {} | |||
|
|||
if settings.DO_NOT_RELOAD_CONTENT_CACHE_AT_STARTUP and not force: |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Preserve original logic, but call softload_json at most once
Yep, this seems to preserve the intended functionality, while allowing flexible cache path writing, and preventing an unnecessary load of the JSON files. |
Write cache data in user space #4109
Resolves #4109.