Skip to content

Commit 7f7a7de

Browse files
committed
chore(controller): add cluster migrate
1 parent 2a757e6 commit 7f7a7de

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from django.core.cache import cache
2+
from django.core.management.commands import migrate
3+
4+
5+
class Command(migrate.Command):
6+
"""Management command for cluster_lock"""
7+
def handle(self, *args, **options):
8+
print("preparing migrate...")
9+
with cache.lock("drycc:controller", timeout=60 * 60 * 24):
10+
super().handle(self, *args, **options)
11+
print("migrate completed...")

rootfs/bin/boot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ python /workspace/manage.py healthchecks
2525

2626
echo ""
2727
echo "Database Migrations:"
28-
python /workspace/manage.py migrate --noinput
28+
python /workspace/manage.py cluster_migrate --noinput
2929

3030
# spawn a gunicorn server in the background
3131
echo ""

0 commit comments

Comments
 (0)