Add artificial delay to wait for tables init

This commit is contained in:
vrde 2016-04-26 17:01:37 +02:00
parent 9d04018533
commit 70b86ce49b
No known key found for this signature in database
GPG Key ID: 6581C7C39B3D397D

View File

@ -2,7 +2,7 @@
for ``argparse.ArgumentParser``.
"""
import os
import time
import argparse
import multiprocessing as mp
import subprocess
@ -20,6 +20,10 @@ def start_rethinkdb():
for line in proc.stdout:
if line.startswith('Server ready'):
# FIXME: seems like tables are not ready when the server is ready,
# that's why we need to sleep a bit before returning.
# Not the optimal solution. Happy to see the right one :)
time.sleep(1)
return proc
exit('Error starting RethinkDB, reason is: {}'.format(line))