|
8 | 8 | from sentry_sdk.integrations.redis import RedisIntegration |
9 | 9 | from sentry_sdk.scrubber import DEFAULT_DENYLIST, EventScrubber |
10 | 10 | from shared.django_apps.db_settings import * |
| 11 | +from shared.helpers.redis import get_redis_url |
11 | 12 | from shared.license import startup_license_logging |
12 | 13 |
|
13 | 14 | from utils.config import SettingsModule, get_config, get_settings_module |
|
265 | 266 | COOKIE_SAME_SITE = "Lax" |
266 | 267 | COOKIE_SECRET = get_config("setup", "http", "cookie_secret") |
267 | 268 | COOKIES_DOMAIN = get_config("setup", "http", "cookies_domain", default=".codecov.io") |
| 269 | + |
| 270 | + |
| 271 | +# Cache configuration |
| 272 | +CACHES = { |
| 273 | + "default": { |
| 274 | + "BACKEND": "django.core.cache.backends.redis.RedisCache", |
| 275 | + "LOCATION": get_redis_url(), |
| 276 | + } |
| 277 | +} |
| 278 | + |
| 279 | + |
| 280 | +# Session configuration |
268 | 281 | SESSION_COOKIE_DOMAIN = get_config( |
269 | 282 | "setup", "http", "cookies_domain", default=".codecov.io" |
270 | 283 | ) |
271 | 284 | SESSION_COOKIE_SECURE = get_config("setup", "secure_cookie", default=True) |
| 285 | + |
| 286 | +SESSION_ENGINE = "django.contrib.sessions.backends.cached_db" |
| 287 | + |
| 288 | + |
272 | 289 | # Defaulting to 'not found' as opposed to 'None' to avoid None somehow getting through as a bearer token. Token strings can't have spaces, hence 'not found' can never be forced as a header input value |
273 | 290 | SUPER_API_TOKEN = os.getenv("SUPER_API_TOKEN", "not found") |
274 | 291 | CODECOV_INTERNAL_TOKEN = os.getenv("CODECOV_INTERNAL_TOKEN", "not found") |
|
0 commit comments