-
Notifications
You must be signed in to change notification settings - Fork 351
[ENG-7879] Ability to resync preprints that have missing doi with Crossref #11121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ENG-7879] Ability to resync preprints that have missing doi with Crossref #11121
Conversation
brianjgeiger
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One very minor CSS thing, and one concern about how the async loop is going to work.
| def sync_preprint_missing_dois(self): | ||
| preprints = Preprint.objects.filter(preprint_doi_created=None) | ||
| for preprint in preprints: | ||
| try: | ||
| preprint.request_identifier_update('doi', create=True) | ||
| except Exception as err: | ||
| logger.warning(f'[{err.__class__.__name__}] Doi creation failed for the preprint with id {preprint._id} because of error: {err}') | ||
| self.retry() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a little weird, because five failed preprints will stop this whole loop from happening. Would it make more sense to just modify the sync_doi_metadata list of things to sync in the case of missing_preprint_dois_only or, failing that, make this function work more like the sync_doi_metadata function does?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this is how I intended it to work but missed running each request_identifier_update as a separate task with its own retry, not the general one
b2efad2
into
CenterForOpenScience:feature/pbs-25-09
…ssref (CenterForOpenScience#11121) ## Purpose Admins should be able to resync preprints without minted doi with Crossref instead of all preprints. ## Changes 1. Added check mark for syncing only preprints without minted DOI. Fixed text coloring that has red background and red text color 2. Improved retry functionality for sync_identifier_doi task 3. Created a new celery task to resync preprints missing DOI and after that exclude all preprints from identifiers queryset ## Ticket https://openscience.atlassian.net/browse/ENG-7879
Purpose
Admins should be able to resync preprints without minted doi with Crossref instead of all preprints.
Changes
Ticket
https://openscience.atlassian.net/browse/ENG-7879?atlOrigin=eyJpIjoiZWRiM2Q0ZWI4YzZlNGRlOTg5NDMzMmRjZWQ5YjQ2NjkiLCJwIjoiaiJ9