We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 84769d7 commit ae494e2Copy full SHA for ae494e2
examples/githubsearch/production/restart.py
@@ -83,10 +83,12 @@ def run(cmd):
83
run(f'nohup {localconstants.PYTHON_EXE} -u runServer.py > {localconstants.GLOBAL_LOG_DIR}/luceneserver.log 2>&1 &')
84
85
# Wait until server is really ready:
86
+ server_log_file = f'{localconstants.GLOBAL_LOG_DIR}/luceneserver.log'
87
while True:
- s = open('%s/luceneserver.log' % localconstants.GLOBAL_LOG_DIR, 'rb').read()
88
- if s.find(('listening on').encode('utf-8')) != -1:
89
- break
+ if os.path.exists(server_log_file):
+ s = open(server_log_file, 'rb').read()
90
+ if s.find(('listening on').encode('utf-8')) != -1:
91
+ break
92
time.sleep(1.0)
93
94
print()
0 commit comments