Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 5a0c613c0b
Fetching contributors…

Cannot retrieve contributors at this time

17 lines (16 sloc) 0.506 kb
#!/usr/bin/env python
from wsgi import *
from django.contrib.auth.models import User
from pymongo.errors import AutoReconnect
import time
deadline = time.time() + 600
while time.time() < deadline:
try:
User.objects.count()
print 'Successfully connected to database.'
exit(0)
except AutoReconnect:
print 'Could not connect to database. Waiting a little bit.'
time.sleep(10)
print 'Could not connect to database after 10 minutes. Something is wrong.'
exit(1)
Jump to Line
Something went wrong with that request. Please try again.