Skip to content

Commit 8f2413a

Browse files
committed
[activity pull][xs]: stop fetching when filtered activities are less than returned ones as it means that all required activities are in the response.
1 parent 955a708 commit 8f2413a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

data_subscriptions/worker/latest_ckan_activity.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ def has_reached_the_end(self, last_response):
5050
if items_returned == 0:
5151
return True
5252

53+
items_after_filter = self.filter_response_for_time_range(last_response)
54+
if len(list(items_after_filter)) < items_returned:
55+
return True
56+
5357
return (self.current_offset > 0) and (
5458
(items_returned < self.server_limit) or (len(self.activity_list) == 0)
5559
)

0 commit comments

Comments
 (0)