Skip to content
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

Don't invalidate caches on the Mac, and warn users that they need to restart after video download #4510

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion kalite/caching/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"""
import os
import glob
import sys

from django.conf import settings; logging = settings.LOG
from django.core.urlresolvers import reverse
Expand Down Expand Up @@ -79,7 +80,9 @@ def invalidate_all_caches():

for filename in glob.glob(os.path.join(CHANNEL_DATA_PATH, "*.cache")):
os.remove(filename)
else:
elif sys.platform != 'darwin':
# Macs have to run video download in a subprocess, and as this is only ever called during runtime from
# video download or the videoscan subprocess, this never actually affects variables in the main KA Lite thread.
initialize_content_caches(force=True)
if caching_is_enabled():
invalidate_web_cache()
Expand Down
4 changes: 3 additions & 1 deletion kalite/updates/views.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import sys

from annoying.decorators import render_to

from django.utils.translation import ugettext as _, ugettext_lazy
Expand Down Expand Up @@ -32,7 +34,7 @@ def update_videos(request, max_to_show=4):
if getattr(settings, 'USING_RASPBERRY_PI', False):
messages.warning(request, _('For low-powered devices like the Raspberry Pi, please download less than 25 videos at a time.'))

if DO_NOT_RELOAD_CONTENT_CACHE_AT_STARTUP:
if DO_NOT_RELOAD_CONTENT_CACHE_AT_STARTUP or sys.platform == 'darwin':

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

messages.warning(request, _('After video download, the server must be restarted for them to be available to users.'))
context.update({
"video_count": VideoFile.objects.filter(percent_complete=100).count(),
Expand Down