diff --git a/reportservice/automatic_run.py b/reportservice/automatic_run.py index 0f3b79cac23d511f543421b089647d4077c567c8..854528dc376f038cd1bda70a4940d9f82efc0185 100644 --- a/reportservice/automatic_run.py +++ b/reportservice/automatic_run.py @@ -9,7 +9,7 @@ import yaml import zmq import zmq.asyncio -async def auto_run(cfg): +async def auto_run(cfg, timeout=3000): """ Run the report service automatically depending on the scheduled times in the run_time list, read from the config yaml file (report_conf.yaml) @@ -38,6 +38,8 @@ async def auto_run(cfg): con = zmq.asyncio.Context() sock = con.socket(zmq.REQ) port = cfg['GLOBAL']['server-port'] + sock.SNDTIMEO = timeout + sock.RCVTIMEO = timeout sock.connect(port) await sock.send_pyobj(['all']) msg = await sock.recv_pyobj() @@ -51,14 +53,20 @@ async def auto_run(cfg): # check every 10mins, if there is # a need for an automatic-run. - await asyncio.sleep(600) + await asyncio.sleep(3000) arg_parser = argparse.ArgumentParser(description='Automatic Launch') -arg_parser.add_argument('--config-file', type=str, default='./report_conf.yaml') -arg_parser.add_argument('--log-file', type=str, default='./report.log') +arg_parser.add_argument('--config-file', type=str, + default='./report_conf.yaml', + help='config file path with reportservice port. ' + 'Default=./report_conf.yaml') +arg_parser.add_argument('--log-file', type=str, default='./report.log', + help='The report log file path. Default=./report.log') arg_parser.add_argument('--logging', type=str, default="INFO", - choices=['INFO', 'DEBUG', 'ERROR']) + help='logging modes: INFO, DEBUG or ERROR. ' + 'Default=INFO', + choices=['INFO', 'DEBUG', 'ERROR']) if __name__ == "__main__": args = vars(arg_parser.parse_args()) diff --git a/reportservice/manual_run.py b/reportservice/manual_run.py index 2c6b9293d19b07d211060a65531c9f3c1f0b2e8b..87f442f196429cc3dbe9c22e1f8b46878b4c8ce8 100644 --- a/reportservice/manual_run.py +++ b/reportservice/manual_run.py @@ -33,13 +33,23 @@ def manual_run(request, cfg): logging.info('{} Manual Run'.format(msg)) arg_parser = argparse.ArgumentParser(description='Manual Launch') -arg_parser.add_argument('--instrument', default=['all'], nargs='+') -arg_parser.add_argument('--testing', dest='testing', action='store_true') +arg_parser.add_argument('--instrument', default=['all'], nargs='+', + help='select the requested instruments. ' + 'Default=all') +arg_parser.add_argument('--testing', dest='testing', action='store_true', + help='required for testing with different' + 'config files') arg_parser.set_defaults(testing=False) -arg_parser.add_argument('--config-file', type=str, default='./report_conf.yaml') -arg_parser.add_argument('--log-file', type=str, default='./report.log') -arg_parser.add_argument('--logging', type=str, default="INFO", - choices=['INFO', 'DEBUG', 'ERROR']) +arg_parser.add_argument('--config-file', type=str, + default='./report_conf.yaml', + help='config file path with reportservice port. ' + 'Default=./report_conf.yaml') +arg_parser.add_argument('--log-file', type=str, default='./report.log', + help='The report log file path. Default=./report.log') +arg_parser.add_argument('--logging', type=str, default="INFO", + help='logging modes: INFO, DEBUG or ERROR. ' + 'Default=INFO', + choices=['INFO', 'DEBUG', 'ERROR']) if __name__ == "__main__": args = vars(arg_parser.parse_args()) diff --git a/reportservice/report_service.py b/reportservice/report_service.py index c39b0e7d75bbb4822fccef256af5d6d6a24f535a..11dd134f836b64f02abcd080e476383e8c38d90f 100644 --- a/reportservice/report_service.py +++ b/reportservice/report_service.py @@ -269,10 +269,16 @@ async def server_runner(config): break arg_parser = argparse.ArgumentParser(description='Start the report service') -arg_parser.add_argument('--config-file', type=str, default='./report_conf.yaml') -arg_parser.add_argument('--log-file', type=str, default='./report.log') +arg_parser.add_argument('--config-file', type=str, + default='./report_conf.yaml', + help='config file path with reportservice port. ' + 'Default=./report_conf.yaml') +arg_parser.add_argument('--log-file', type=str, default='./report.log', + help='The report log file path. Default=./report.log') arg_parser.add_argument('--logging', type=str, default="INFO", - choices=['INFO', 'DEBUG', 'ERROR']) + help='logging modes: INFO, DEBUG or ERROR. ' + 'Default=INFO', + choices=['INFO', 'DEBUG', 'ERROR']) if __name__ == "__main__": args = vars(arg_parser.parse_args())