Skip to content

Commit 955a708

Browse files
committed
[debug][xs]: add logging when syncing dbs so we can understand whats happening.
1 parent 6ca589a commit 955a708

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

data_subscriptions/worker/latest_ckan_activity.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import datetime as dt
22
import os
3+
import logging
34

45
from ckanapi import RemoteCKAN
56

@@ -18,12 +19,12 @@ def __init__(self, url=None, start_time=None, proposed_limit=100):
1819
def __call__(self):
1920
with RemoteCKAN(
2021
self.url,
21-
user_agent=
22-
"data-subscription/latest (API call for CKAN recent activity pull)",
22+
user_agent="data-subscription/latest (API call for CKAN recent activity pull)",
2323
) as api:
2424

2525
self.activity_list = []
2626
while True:
27+
logging.info(f"LatestCKANActivity: fetching activities {self.server_limit} - {self.current_offset}")
2728
response = api.action.recently_changed_packages_activity_list(
2829
limit=self.server_limit, offset=self.current_offset
2930
)
@@ -32,7 +33,9 @@ def __call__(self):
3233
self.server_limit = len(response)
3334
self.current_offset += self.server_limit
3435
if self.has_reached_the_end(response):
36+
logging.info("LatestCKANActivity: has reached the end - stop")
3537
break
38+
logging.info("LatestCKANActivity: return list of activities")
3639
return self.activity_list
3740

3841
def filter_response_for_time_range(self, response):

0 commit comments

Comments
 (0)