Avoid DNS timeout in non-Docker for Mac installs

Shaves 20 seconds off of rebooting the dev environment on Linux.
This commit is contained in:
Shane McDonald
2019-05-10 12:19:39 -04:00
parent 18c69fa391
commit 5ca0cdb124
3 changed files with 6 additions and 5 deletions

View File

@@ -155,10 +155,10 @@ CELERYBEAT_SCHEDULE.update({ # noqa
CLUSTER_HOST_ID = socket.gethostname()
try:
socket.gethostbyname('docker.for.mac.host.internal')
if 'Docker for Mac' in os.getenv('OS', ''):
os.environ['SDB_NOTIFY_HOST'] = 'docker.for.mac.host.internal'
except Exception:
else:
os.environ['SDB_NOTIFY_HOST'] = os.popen('ip route').read().split(' ')[2]
WEBSOCKET_ORIGIN_WHITELIST = ['https://localhost:8043', 'https://localhost:3000']