Skip to content

Commit baa081e

Browse files
ponyisiBenGalewsky
authored andcommitted
Push intermediate results
1 parent 8688dca commit baa081e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/servicex_did_finder_lib/did_finder_app.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,11 @@ def do_lookup(self, did: str, dataset_id: int, endpoint: str, user_did_finder: U
9797
try:
9898
for file_info in user_did_finder(did_info.did, info, self.app.did_finder_args):
9999
acc.add(file_info)
100+
if did_info.file_count == -1:
101+
acc.send_on(-1) # if looking up full dataset, can send partial results
100102

101-
acc.send_on(did_info.file_count)
103+
if did_info.file_count > 0: # otherwise wait until all files arrive, then limit results
104+
acc.send_on(did_info.file_count)
102105
except Exception:
103106
# noinspection PyTypeChecker
104107
self.logger.error(

0 commit comments

Comments
 (0)