Skip to content

Commit

Permalink
Previous PR append - wait for databse
Browse files Browse the repository at this point in the history
The real cause the problem here is that the database migration was failing due to the database not being connectable on startup. The statement is just skipped, so the databse is never migrated as the database is up by the time the app is starting.

We'll wait 15 seconds in the startup script before running the migration, ensuring that the database has started. Looking at logs, the database is ready for connections a few seconds after the error is thrown so this should be sufficient.
  • Loading branch information
zediious committed Jun 9, 2024
1 parent 53e587f commit 7c22498
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docker/init/run-raptorapp-prod.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
# Move to app directory
cd raptorWebApp

# Wait for 15 seconds to allow database to start completely
sleep 15

# Migrate database
python manage.py migrate

Expand Down

1 comment on commit 7c22498

@zediious
Copy link
Owner Author

Choose a reason for hiding this comment

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

Not certain why this issue has not surfaced until now

Please sign in to comment.