refactor(db): update cursor rules and enhance deployment rollback script

- Standardized string formatting in cursor rules for consistency.
- Added a new rollback deployment script to facilitate blue-green deployment strategy.
- Removed outdated seed data files and introduced new rarity mappings for better data management.
- Improved model relationships and query optimizations in various views and admin configurations.
- Enhanced caching strategies across templates to improve performance and reduce load times, including jitter in cache settings for better performance.
- Refactored card-related views and templates to utilize new model fields and relationships.
This commit is contained in:
badblocks 2025-06-19 15:42:36 -07:00
parent 39a002e394
commit af2f48a491
No known key found for this signature in database
37 changed files with 2444 additions and 13565 deletions

View file

@ -1,9 +1,23 @@
import random
from django.conf import settings
def cache_settings(request):
"""
Pass cache settings to the template context.
Applies jitter to the timeouts.
"""
jitter = settings.CACHE_JITTER
return {
"CACHE_TIMEOUT": settings.CACHE_TIMEOUT,
"CACHE_SHORT_TIMEOUT": settings.CACHE_SHORT_TIMEOUT
+ random.randint(-jitter, jitter),
"CACHE_MEDIUM_TIMEOUT": settings.CACHE_MEDIUM_TIMEOUT
+ random.randint(-jitter, jitter),
"CACHE_LONG_TIMEOUT": settings.CACHE_LONG_TIMEOUT
+ random.randint(-jitter, jitter),
"CACHE_DEFAULT_TIMEOUT": settings.CACHE_DEFAULT_TIMEOUT
+ random.randint(-jitter, jitter),
}