use the current pid, not the one from the iteration before

This commit is contained in:
2024-08-07 17:30:55 +02:00
parent 0914b8d169
commit 474df55969

View File

@ -44,19 +44,11 @@ def work(backend_address, accumulator_host, accumulator_port, visualisation_host
zmq_socks = ZMQSockets(backend_address, accumulator_host, accumulator_port, visualisation_host, visualisation_port) zmq_socks = ZMQSockets(backend_address, accumulator_host, accumulator_port, visualisation_host, visualisation_port)
pulse_id = 0
n_aggregated_images = 1 n_aggregated_images = 1
data_summed = None data_summed = None
while True: while True:
try:
peakfinder_parameters = bj_peakfinder_parameters.load()
except Exception as e:
print(f"({pulse_id}) cannot read peakfinder parameters file: {e}", flush=True) #TODO: logging?
if not zmq_socks.has_data(): if not zmq_socks.has_data():
continue continue
@ -65,8 +57,15 @@ def work(backend_address, accumulator_host, accumulator_port, visualisation_host
if metadata["shape"] == [2, 2]: # this is used as marker for empty images if metadata["shape"] == [2, 2]: # this is used as marker for empty images
continue continue
pulse_id = metadata.get("pulse_id", 0) pulse_id = metadata.get("pulse_id", 0)
try:
peakfinder_parameters = bj_peakfinder_parameters.load()
except Exception as e:
print(f"({pulse_id}) cannot read peakfinder parameters file: {e}", flush=True) #TODO: logging?
results = metadata.copy() results = metadata.copy()
results.update(peakfinder_parameters) results.update(peakfinder_parameters)