From 8d17a16b6977cb16bbbb839fdc62e4c5ff7458fa Mon Sep 17 00:00:00 2001 From: Sven Augustin Date: Fri, 3 May 2024 15:59:30 +0200 Subject: [PATCH] moved mk_updates --- slic/core/acquisition/broker/post_retrieve.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/slic/core/acquisition/broker/post_retrieve.py b/slic/core/acquisition/broker/post_retrieve.py index aa6e9d36..6d403d5c 100644 --- a/slic/core/acquisition/broker/post_retrieve.py +++ b/slic/core/acquisition/broker/post_retrieve.py @@ -25,9 +25,7 @@ def post_retrieve(addr, endstation, pgroup, run, acqs=None, continue_run=False): else: fns = mk_fns_acqs(dir_run_meta, acqs) - updates = mk_updates(addr, pgroup, continue_run) - - post_retrieve_fns_acqs(addr, fns, updates) + post_retrieve_fns_acqs(addr, fns, continue_run=continue_run) def mk_dir_run_meta(endstation, pgroup, run): @@ -62,19 +60,23 @@ def mk_updates(addr, pgroup, continue_run): return updates -def post_retrieve_fns_acqs(addr, fns, updates): +def post_retrieve_fns_acqs(addr, fns, continue_run=False): for fn in fns: - post_retrieve_fn_acq(addr, fn, updates) + post_retrieve_fn_acq(addr, fn, continue_run=continue_run) sleep(WAIT_BETWEEN_REQUESTS) -def post_retrieve_fn_acq(addr, fn, updates): +def post_retrieve_fn_acq(addr, fn, continue_run=False): print("🛠️ working on:", fn) req = json_load(fn) print("🔎 read original request:", pretty_dict(req)) + + pgroup = req["pgroup"] + updates = mk_updates(addr, pgroup, continue_run) if updates: print("🖊️ updating request:", pretty_dict(updates)) req.update(updates) print("🪥 new request:", pretty_dict(req)) + resp = restapi.retrieve(addr, req) print("💌 response:", pretty_dict(resp)) print()