mirror of
https://github.com/viq/NewsBlur.git
synced 2025-04-13 09:38:09 +00:00
19 lines
579 B
Python
19 lines
579 B
Python
import time
|
|
|
|
from django.core.management.base import BaseCommand
|
|
from django.db import connections
|
|
from django.db.utils import OperationalError
|
|
|
|
|
|
class Command(BaseCommand):
|
|
def handle(self, *args, **options):
|
|
db_conn = connections["default"]
|
|
connected = False
|
|
while not connected:
|
|
try:
|
|
c = db_conn.cursor()
|
|
connected = True
|
|
# print("Connected to postgres")
|
|
except OperationalError as e:
|
|
print(f" ---> Waiting for db_postgres: {e}")
|
|
time.sleep(5)
|