Skip to content

Commit

Permalink
#603 Create timeouts for cache warmup (#616)
Browse files Browse the repository at this point in the history
  • Loading branch information
duker33 committed Oct 24, 2018
1 parent 3a135bd commit 1ea961c
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docker/docker-compose-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ services:
networks:
- se-backend
- se-frontend
command: ./docker/wait-for.sh postgres:5432 -- gunicorn shopelectro.wsgi:application -c /etc/gunicorn.py -b 0.0.0.0:$VIRTUAL_HOST_PORT
command: gunicorn shopelectro.wsgi:application -c /etc/gunicorn.py -b 0.0.0.0:$VIRTUAL_HOST_PORT

celery-beat:
image: fidals/se:prod
Expand Down
6 changes: 5 additions & 1 deletion docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ services:
- $VIRTUAL_HOST_LIVESERVER_PORT
networks:
- se-backend
command: ./docker/wait-for.sh postgres:5432 -- python manage.py runserver 0.0.0.0:$VIRTUAL_HOST_PORT
# @todo #603:60m Resurrect postgres waiting
# This prefix for app docker service's command does not work:
# `./docker/wait-for.sh postgres:5432 -- `
# Prefix was used in docker-compose-production too.
command: python manage.py runserver 0.0.0.0:$VIRTUAL_HOST_PORT

app-drone:
extends: app-base
Expand Down
1 change: 1 addition & 0 deletions etc/gunicorn.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@
worker_class = 'sync'
max_requests = 300
max_requests_jitter = 300
timeout = 120
errorlog = '-'
2 changes: 2 additions & 0 deletions etc/nginx/default.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ server {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# for cache warmup
proxy_read_timeout 120s;
proxy_pass http://app:8000;
}

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ ua-parser==0.8.0
user-agents==1.1.0
sorl-thumbnail==12.4a1
https://github.com/selwin/django-user_agents/archive/master.zip
https://github.com/fidals/refarm-site/archive/0.4.8.zip
https://github.com/fidals/refarm-site/archive/0.4.9.zip
1 change: 1 addition & 0 deletions shopelectro/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ class ExcludedModelTPageQuerySet(pages_models.PageQuerySet):
def exclude_type(self):
return self.exclude(type=pages_models.Page.MODEL_TYPE)


# @todo #rf169:30m Fix model.Manager bad inheritance
# Now we have this problem:
# ```
Expand Down

1 comment on commit 1ea961c

@0pdd
Copy link
Collaborator

@0pdd 0pdd commented on 1ea961c Oct 24, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Puzzle 603-bf36ae82 discovered in docker/docker-compose.yml and submitted as #617. Please, remember that the puzzle was not necessarily added in this particular commit. Maybe it was added earlier, but we discovered it only now.

Please sign in to comment.