Skip to content

Commit

Permalink
Feedback from review
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonGrace2282 committed Jan 17, 2025
1 parent f522db2 commit ba862d1
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 21 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ on:
- push
- pull_request

env:
CI: 1

defaults:
run:
shell: bash
Expand Down
19 changes: 4 additions & 15 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,8 @@ services:
- django
volumes:
- .:/app

celerybeat:
container_name: tin_celerybeat
image: tin-base
entrypoint:
- celery
- -A
- tin
- beat
networks:
- tin-network
volumes:
- .:/app
depends_on:
- django
environment:
IN_DOCKER: true

django:
container_name: tin_django
Expand All @@ -55,6 +42,8 @@ services:
- redis
healthcheck:
test: ["CMD", "curl", "-f", "http://0.0.0.0:8000"]
environment:
IN_DOCKER: true

networks:
tin-network:
Expand Down
6 changes: 3 additions & 3 deletions tin/settings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True

CI = "CI" in os.environ
IN_DOCKER = os.environ.get("IN_DOCKER", False)

ALLOWED_HOSTS = [
"127.0.0.1",
Expand Down Expand Up @@ -110,7 +110,7 @@
"BACKEND": "channels_redis.core.RedisChannelLayer",
"CONFIG": {
"hosts": [
("redis" if not CI and DEBUG else "localhost", 6379),
("redis" if IN_DOCKER else "localhost", 6379),
]
},
},
Expand Down Expand Up @@ -240,7 +240,7 @@
CELERY_RESULT_BACKEND = "django-db"


if not CI and DEBUG:
if IN_DOCKER:
CELERY_BROKER_URL = "redis://redis:6379/0"
else:
CELERY_BROKER_URL = "redis://localhost:6379/1"
Expand Down

0 comments on commit ba862d1

Please sign in to comment.