Skip to content

Commit

Permalink
Adding results caching
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Nov 14, 2024
1 parent e392a47 commit f84a83f
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ jobs:
with:
python-version: 3.13

- name: Start Redis
uses: supercharge/redis-github-action@1.7.0
with:
redis-version: 7.0.5

- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ jobs:
pip install -r requirements.txt
pip install -r requirements-dev.txt
- name: Start Redis
uses: supercharge/redis-github-action@1.7.0
with:
redis-version: 7.0.5

- name: Run tests
env:
ENV: dev
Expand Down
6 changes: 3 additions & 3 deletions crank/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,10 @@
# See https://docs.djangoproject.com/en/4.2/howto/deployment/checklist/

# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = os.environ["SECRET_KEY"]
# SECRET_KEY = os.environ["SECRET_KEY"]

# SECURITY WARNING: don't run with debug turned on in production!

CPU_COUNT = multiprocessing.cpu_count()

# Application definition

Expand Down Expand Up @@ -149,6 +148,7 @@
# Database
# https://docs.djangoproject.com/en/4.2/ref/settings/#databases

CPU_COUNT = multiprocessing.cpu_count()

EXTENSIONS_MAX_UNIQUE_QUERY_ATTEMPTS = 1000

Expand All @@ -161,7 +161,7 @@
CACHE_TIMEOUT = 20 # Timeout for Redis cached items in seconds
REDIS_URL = os.environ["REDIS_URL"]
# Optional: To use Redis for session storage

SESSION_CACHE_ALIAS = 'default'
CACHES = {
'default': {
'BACKEND': 'django_redis.cache.RedisCache',
Expand Down
1 change: 1 addition & 0 deletions crank/settings/dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

BASE_DIR = Path(__file__).resolve().parent.parent.parent
DEBUG = True
SECRET_KEY = os.environ["SECRET_KEY"]
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
Expand Down
1 change: 1 addition & 0 deletions crank/settings/prod.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
BASE_DIR = Path(__file__).resolve().parent.parent.parent
DEBUG = False
# SECURE_SSL_REDIRECT = True
SECRET_KEY = os.environ.get('SECRET_KEY')
SESSION_COOKIE_SECURE = True
SESSION_COOKIE_HTTPONLY = True
CSRF_COOKIE_SECURE = True
Expand Down
1 change: 1 addition & 0 deletions crank/settings/staging.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

BASE_DIR = Path(__file__).resolve().parent.parent.parent
DEBUG = False
SECRET_KEY = os.environ["SECRET_KEY"]

DATABASES = {
'default': {
Expand Down

0 comments on commit f84a83f

Please sign in to comment.