From 687e9644b2be2b4d786de1af772224c836570870 Mon Sep 17 00:00:00 2001 From: Sven Augustin Date: Wed, 15 Oct 2025 12:06:49 +0200 Subject: [PATCH] remove creation of very_first_start.dap --- dap/accumulator.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/dap/accumulator.py b/dap/accumulator.py index 02a69db..d7cad05 100644 --- a/dap/accumulator.py +++ b/dap/accumulator.py @@ -30,9 +30,8 @@ def accumulate(_accumulator_host, accumulator_port): #TODO: accumulator_host is poller.register(accumulator_socket, zmq.POLLIN) - run_name_before = "very_first_start" - fname_output = f"{OUTPUT_DIR_NAME}/{run_name_before}.dap" - output_dap = open_new_file(fname_output) + run_name_before = None + output_dap = None n_frames_received = 0 @@ -40,7 +39,8 @@ def accumulate(_accumulator_host, accumulator_port): #TODO: accumulator_host is events = dict(poller.poll(10)) # check for worker output every 0.01 seconds if accumulator_socket not in events: - output_dap.flush() # may be too intensive + if output_dap: + output_dap.flush() # may be too intensive continue results = accumulator_socket.recv_json(FLAGS) @@ -52,8 +52,9 @@ def accumulate(_accumulator_host, accumulator_port): #TODO: accumulator_host is if run_name != run_name_before: run_name_before = run_name - fname_output = f"{OUTPUT_DIR_NAME}/{detector}/{run_name_before}.dap" - output_dap.close() + fname_output = f"{OUTPUT_DIR_NAME}/{detector}/{run_name}.dap" + if output_dap: + output_dap.close() output_dap = open_new_file(fname_output) res_is_good_frame = results.get("is_good_frame", -1)