Skip to content

Commit

Permalink
Add cache calls or notubiz. See #452
Browse files Browse the repository at this point in the history
  • Loading branch information
breyten committed Jan 26, 2024
1 parent 7c5b188 commit bebad92
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions ocd_backend/extractors/notubiz.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ def run(self):

committee_count = 0
for committee in json.load(response.media_file)['gremia']:

yield 'application/json', \
json.dumps(committee), \
committee_url, \
'notubiz/' + cached_path,
committee_count += 1
if not self.check_if_most_recent('notubiz', self.source_definition['notubiz_organization_id'], 'committee', committee['id'], committee):
yield 'application/json', \
json.dumps(committee), \
committee_url, \
'notubiz/' + cached_path,
committee_count += 1

log.info(f'[{self.source_definition["key"]}] Extracted total of {committee_count} notubiz committees.')

Expand Down Expand Up @@ -164,11 +164,12 @@ def run(self):
pass
meeting_json['attributes'] = attributes

yield 'application/json', \
json.dumps(meeting_json), \
meeting_url, \
'notubiz/' + cached_path,
meeting_count += 1
if not self.check_if_most_recent('notubiz', self.source_definition['notubiz_organization_id'], 'meeting', meeting['id'], eeting_json):
yield 'application/json', \
json.dumps(meeting_json), \
meeting_url, \
'notubiz/' + cached_path,
meeting_count += 1

page += 1

Expand Down

0 comments on commit bebad92

Please sign in to comment.