This repository has been archived by the owner on Aug 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Redis for Celery Result Backend (#348)
* Disable Celery worker mingling * Enable Redis result backend * Setup Redis in dev container * Ensure tasks are invoked correctly in tests * Add Redis to commit tests * Remove unnecessary Redis memory optimization * Use REDIS_URL environment variable * Pin to Redis 7.0 * Pin to PostgreSQL 14.10 * Pin to Redis 7
- Loading branch information
1 parent
506e13f
commit d2abb22
Showing
10 changed files
with
28 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
ADMIN=NAME,[email protected] | ||
ALLOWED_HOSTS=rebootcanadadb.herokuapp.com,rebootcanada.herokuapp.com,localhost,0.0.0.0,127.0.0.1 | ||
CELERY_RESULT_BACKEND="rpc://" | ||
CLOUDAMQP_APIKEY= | ||
CLOUDAMQP_URL= | ||
CSRF_TRUSTED_ORIGINS=.preview.app.github.dev | ||
|
@@ -14,6 +13,7 @@ EMAIL_HOST=smtp.gmail.com | |
EMAIL_HOST_DISPLAY_NAME= | ||
EMAIL_HOST_USER= | ||
EMAIL_HOST_PASSWORD= | ||
REDIS_URL="redis://localhost:6379/0" | ||
# SECRET_KEY: Check out https://www.miniwebtool.com/django-secret-key-generator/ for generating new key | ||
SECRET_KEY=abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+) | ||
SECURE_SSL_REDIRECT=False | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,7 +52,6 @@ jobs: | |
env: | ||
ADMIN: NAME,[email protected] | ||
ALLOWED_HOSTS: localhost,0.0.0.0,127.0.0.1 | ||
CELERY_RESULT_BACKEND: "rpc://" | ||
CSRF_TRUSTED_ORIGINS: "" | ||
DB_NAME: reboot | ||
DB_USER: root | ||
|
@@ -62,12 +61,13 @@ jobs: | |
EMAIL_HOST: smtp.gmail.com | ||
EMAIL_HOST_USER: "" | ||
EMAIL_HOST_PASSWORD: "" | ||
REDIS_URL: "redis://localhost:6379/0" | ||
SECRET_KEY: ${{ github.run_id }}-${{ github.run_attempt }} | ||
SECURE_SSL_REDIRECT: False | ||
|
||
services: | ||
postgres: | ||
image: postgres:13 | ||
image: postgres:14.10 | ||
env: | ||
POSTGRES_USER: ${{ env.DB_USER }} | ||
POSTGRES_PASSWORD: ${{ env.DB_PASSWORD }} | ||
|
@@ -76,6 +76,12 @@ jobs: | |
- 5432:5432 | ||
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 | ||
|
||
redis: | ||
image: redis:7 | ||
ports: | ||
- 6379:6379 | ||
options: --entrypoint redis-server --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5 | ||
|
||
steps: | ||
- name: Checkout the Git repository | ||
uses: actions/checkout@v3 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
worker: celery worker -A reboot --without-gossip --without-heartbeat | ||
worker: celery worker -A reboot --without-heartbeat --without-gossip --without-mingle | ||
web: gunicorn reboot.wsgi --log-level info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters