Verified Commit 3a94462b authored by Eliot Berriot's avatar Eliot Berriot
Browse files

Removed django-cacheops dependency

parent 9a8de804
......@@ -10,5 +10,4 @@ PYTHONDONTWRITEBYTECODE=true
WEBPACK_DEVSERVER_PORT=8080
MUSIC_DIRECTORY_PATH=/music
BROWSABLE_API_ENABLED=True
CACHEOPS_ENABLED=False
FORWARDED_PROTO=http
......@@ -143,7 +143,6 @@ test_api:
DJANGO_ALLOWED_HOSTS: "localhost"
DATABASE_URL: "postgresql://postgres@postgres/postgres"
FUNKWHALE_URL: "https://funkwhale.ci"
CACHEOPS_ENABLED: "false"
DJANGO_SETTINGS_MODULE: config.settings.local
only:
- branches
......
......@@ -92,7 +92,6 @@ THIRD_PARTY_APPS = (
"rest_auth.registration",
"dynamic_preferences",
"django_filters",
"cacheops",
"django_cleanup",
"versatileimagefield",
)
......@@ -421,15 +420,6 @@ PROTECT_FILES_PATH = env("PROTECT_FILES_PATH", default="/_protected")
# use this setting to tweak for how long you want to cache
# musicbrainz results. (value is in seconds)
MUSICBRAINZ_CACHE_DURATION = env.int("MUSICBRAINZ_CACHE_DURATION", default=300)
CACHEOPS_REDIS = env("CACHE_URL", default=CACHE_DEFAULT)
CACHEOPS_ENABLED = env.bool("CACHEOPS_ENABLED", default=True)
CACHEOPS = {
"music.artist": {"ops": "all", "timeout": 60 * 60},
"music.album": {"ops": "all", "timeout": 60 * 60},
"music.track": {"ops": "all", "timeout": 60 * 60},
"music.trackfile": {"ops": "all", "timeout": 60 * 60},
"taggit.tag": {"ops": "all", "timeout": 60 * 60},
}
# Custom Admin URL, use {% url 'admin:index' %}
ADMIN_URL = env("DJANGO_ADMIN_URL", default="^api/admin/")
......
......@@ -51,12 +51,6 @@ CSRF_TRUSTED_ORIGINS = ALLOWED_HOSTS
# END SITE CONFIGURATION
# STORAGE CONFIGURATION
# ------------------------------------------------------------------------------
# Uploaded Media Files
# ------------------------
DEFAULT_FILE_STORAGE = "django.core.files.storage.FileSystemStorage"
# Static Assets
# ------------------------
STATICFILES_STORAGE = "django.contrib.staticfiles.storage.StaticFilesStorage"
......
import cacheops
from django.core.management.base import BaseCommand
from django.db import transaction
from django.db.models import Q
......@@ -24,7 +23,6 @@ class Command(BaseCommand):
self.fix_mimetypes(**options)
self.fix_file_data(**options)
self.fix_file_size(**options)
cacheops.invalidate_model(models.TrackFile)
@transaction.atomic
def fix_mimetypes(self, dry_run, **kwargs):
......
......@@ -107,13 +107,6 @@ class PlaylistSerializer(serializers.ModelSerializer):
covers = []
max_covers = 5
for plt in plts:
if not hasattr(plt.track.album.cover, "crop"):
# In some rare situations, we end up with the following stack strace:
# AttributeError: 'VersatileImageFieldFile' object has no attribute 'crop'
# I tend to thing our complex prefetch logic is troubling for versatile
# image field, so wi initialize the missing attribute by hand, cf
# https://github.com/respondcreate/django-versatileimagefield/blob/1.9/versatileimagefield/mixins.py#L108
plt.track.album.cover.build_filters_and_sizers((0.5, 0, 5), False)
url = plt.track.album.cover.crop["200x200"].url
if url in covers:
continue
......
......@@ -58,7 +58,6 @@ python-magic==0.4.15
ffmpeg-python==0.1.10
channels>=2,<2.1
channels_redis>=2.1,<2.2
django-cacheops>=4,<4.1
daphne==2.0.4
cryptography>=2,<3
......
......@@ -18,5 +18,4 @@ env =
EMAIL_CONFIG=consolemail://
CELERY_BROKER_URL=memory://
CELERY_TASK_ALWAYS_EAGER=True
CACHEOPS_ENABLED=False
FEDERATION_HOSTNAME=test.federation
Removed django-cacheops dependency
Removed Cacheops dependency
---------------------------
We removed one of our dependency named django-cacheops. It was unly used in a few places,
and not playing nice with other dependencies.
You can safely remove this dependency in your environment with ``pip uninstall django-cacheops`` if you're
not using docker.
You can also safely remove any ``CACHEOPS_ENABLED`` setting from your environment file.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment