Skip to content

Commit

Permalink
Merge branch 'fix-roles-refresh' of 'https://github.com/jjmerchante/g…
Browse files Browse the repository at this point in the history
  • Loading branch information
sduenas authored Aug 9, 2024
2 parents f2a96e0 + 12b99cf commit cd40634
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
12 changes: 12 additions & 0 deletions releases/unreleased/identity-refresh-bug-for-some-items.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: Identity refresh bug for some items
category: fixed
author: Jose Javier Merchante <[email protected]>
issue: null
notes: >
Fix issue where some fields were not refreshed.
The bug occurred because the queries to OpenSearch filtered
items in which `author_uuid` was the individual pk, but not
when the `<role>_uuid` was the individual pk. That causes many
items that contain the `<role>_uuid` but not the `author_uuid`
not to be refreshed.
4 changes: 4 additions & 0 deletions sirmordred/task_enrich.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,16 @@ def __autorefresh(self, enrich_backend, studies=False):
next_autorefresh = self.__update_last_autorefresh()

logger.debug('Getting last modified identities from SH since %s for %s', after, self.backend_section)

author_fields = ["author_uuid"]
for role in enrich_backend.roles:
author_fields.append(role + '_uuid')
try:
meta_fields = enrich_backend.meta_fields
author_fields += meta_fields
except AttributeError:
pass

logger.debug("Refreshing identity ids for %s", self.backend_section)
total = 0
time_start = datetime.now()
Expand Down

0 comments on commit cd40634

Please sign in to comment.