From cbe1d881e71feec2973e4dbcd4355f64cc68d074 Mon Sep 17 00:00:00 2001 From: Peter Onyisi Date: Tue, 12 Nov 2024 19:03:23 -0600 Subject: [PATCH] Push intermediate results --- src/servicex_did_finder_lib/did_finder_app.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/servicex_did_finder_lib/did_finder_app.py b/src/servicex_did_finder_lib/did_finder_app.py index 87407e5..b167f4e 100644 --- a/src/servicex_did_finder_lib/did_finder_app.py +++ b/src/servicex_did_finder_lib/did_finder_app.py @@ -97,8 +97,11 @@ def do_lookup(self, did: str, dataset_id: int, endpoint: str, user_did_finder: U try: for file_info in user_did_finder(did_info.did, info, self.app.did_finder_args): acc.add(file_info) + if did_info.file_count == -1: + acc.send_on(-1) # if looking up full dataset, can send partial results - acc.send_on(did_info.file_count) + if did_info.file_count > 0: # otherwise wait until all files arrive, then limit results + acc.send_on(did_info.file_count) except Exception: # noinspection PyTypeChecker self.logger.error(