Fixup a logic bug with the waiting for migrations. We can't do that if we're in seperate services, we just have to take it on the chin.

This commit is contained in:
Greyscale 2023-03-02 17:24:08 +01:00
parent c580ecf331
commit a87482c871
No known key found for this signature in database
GPG key ID: 74BAFF55434DA4B2
2 changed files with 16 additions and 13 deletions

View file

@ -4,12 +4,14 @@ rm -f /var/lock/laravel_horizon_started
# If horizon is present, publish the frontend assets, if HORIZON_UI is set to "on"
if [ "${HORIZON_ENABLE,,}" = "on" ]; then
if [[ -f "/app/config/horizon.php" ]]; then
echo "[HORIZON] Waiting until Migration Complete."
until [ -f /var/lock/laravel_migration_complete ]
do
sleep 1
done
echo "[HORIZON] Migration is complete, running Horizon."
if [ "${MIGRATE_ENABLE}" = "on" ]; then
echo "[HORIZON] Waiting until Migration Complete."
until [ -f /var/lock/laravel_migration_complete ]
do
sleep 1
done
echo "[HORIZON] Migration is complete, running Horizon."
fi
if [ "${HORIZON_UI,,}" = "on" ]; then
echo "[HORIZON] Publishing horizon frontend assets"
artisan horizon:publish

View file

@ -1,13 +1,14 @@
#!/bin/bash
cd /app
if [ "${SCHEDULER_ENABLE,,}" = "on" ]; then
echo "[SCHEDULER] Waiting until Migration Complete."
until [ -f /var/lock/laravel_migration_complete ]
do
sleep 1
done
echo "[SCHEDULER] Migrations complete, starting scheduler"
if [ "${MIGRATE_ENABLE}" = "on" ]; then
echo "[SCHEDULER] Waiting until Migration Complete."
until [ -f /var/lock/laravel_migration_complete ]
do
sleep 1
done
echo "[SCHEDULER] Migrations complete, starting scheduler"
fi
while true; do
artisan schedule:run
sleep 59;