gold eggs backend
Some checks failed
Build and Push to Docker Hub / build-test-push (push) Failing after 1m55s

This commit is contained in:
2026-04-15 08:59:36 +02:00
commit ab73d05ecc
359 changed files with 14415 additions and 0 deletions

17
core/utils/cache.py Executable file
View File

@@ -0,0 +1,17 @@
import hashlib
from django.core.cache import cache
from common.env import env
class Cache:
def remember(self, func, key: str):
cache_enabled = env("CACHE_ENABLED")
key = hashlib.md5(key.encode("utf-8")).hexdigest()
response = cache.get(key)
if (response is None) or cache_enabled:
response = func()
cache.set(key, response, env("CACHE_TIME"))
return response