Skip to content
Snippets Groups Projects
Commit 67e1fddc authored by Thomas Kluyver's avatar Thomas Kluyver
Browse files

Flush stdout after printing

parent 48e03999
No related branches found
No related tags found
1 merge request!683[Webservice] Restructure database to give more meaningful success/failure information
......@@ -231,7 +231,7 @@ class RequestHandler(BaseHTTPRequestHandler):
detector, instrument, in_folder, out_folder, report_to, runs = \
self.parse_calibrate_command(command)
except Exception as e:
print("Failed parsing xfel-calibrate command", e)
print("Failed parsing xfel-calibrate command", e, flush=True)
continue
key = detector if instrument in detector else f"{instrument}-{detector}" # noqa
......@@ -283,7 +283,7 @@ class RequestHandler(BaseHTTPRequestHandler):
detector, instrument, in_folder, out_folder, report_to, runs = \
self.parse_calibrate_command(command)
except Exception as e:
print("Failed parsing xfel-calibrate command", e)
print("Failed parsing xfel-calibrate command", e, flush=True)
continue
inst_records = last_calib.setdefault(instrument, [])
......@@ -309,11 +309,11 @@ def run(config_file: Optional[str] = None):
with open(config["web-service"]["cal-config"], "r") as cf:
global cal_config
cal_config = yaml.load(cf.read(), Loader=yaml.FullLoader)
print('starting server...')
print('starting server...', flush=True)
sconfig = config["server-config"]
server_address = (sconfig["host"], sconfig["port"])
httpd = HTTPServer(server_address, RequestHandler)
print('running server...')
print('running server...', flush=True)
httpd.serve_forever()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment