Skip to content

Commit 3b084cb

Browse files
committed
chore(passport): add cluster migrate
1 parent d0bf429 commit 3b084cb

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:passport", 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
@@ -24,7 +24,7 @@ python /workspace/manage.py healthchecks
2424

2525
echo ""
2626
echo "Database Migrations:"
27-
python /workspace/manage.py migrate --noinput
27+
python /workspace/manage.py cluster_migrate --noinput
2828

2929
echo ""
3030
echo "Collect static files in a single location:"

0 commit comments

Comments
 (0)