Create cache table on start
This commit is contained in:
parent
61f05a9a23
commit
951d534489
1 changed files with 5 additions and 7 deletions
|
|
@ -6,18 +6,16 @@ set -e
|
||||||
# Debug
|
# Debug
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
# Wait for database
|
|
||||||
echo "Waiting for database"
|
|
||||||
while ! nc -z "$POSTGRES_HOST" "$POSTGRES_PORT"; do
|
|
||||||
sleep 0.1
|
|
||||||
done
|
|
||||||
echo "Database started"
|
|
||||||
|
|
||||||
# 2. Apply database migrations
|
# 2. Apply database migrations
|
||||||
echo "Apply database migrations"
|
echo "Apply database migrations"
|
||||||
python manage.py migrate
|
python manage.py migrate
|
||||||
echo "Apply database migrations done"
|
echo "Apply database migrations done"
|
||||||
|
|
||||||
|
# 3. Create cache table
|
||||||
|
echo "Create cache table"
|
||||||
|
python manage.py createcachetable
|
||||||
|
echo "Create cache table done"
|
||||||
|
|
||||||
# https://docs.gunicorn.org/en/stable/design.html#how-many-workers
|
# https://docs.gunicorn.org/en/stable/design.html#how-many-workers
|
||||||
num_cores=$(nproc --all)
|
num_cores=$(nproc --all)
|
||||||
workers=$((2 * num_cores + 1))
|
workers=$((2 * num_cores + 1))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue