Skip to content

Conversation

@ihorsokhanexoft
Copy link
Contributor

@ihorsokhanexoft ihorsokhanexoft commented Apr 30, 2025

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?atlOrigin=eyJpIjoiZWRiM2Q0ZWI4YzZlNGRlOTg5NDMzMmRjZWQ5YjQ2NjkiLCJwIjoiaiJ9

Copy link
Collaborator

@brianjgeiger brianjgeiger left a 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.

Comment on lines 63 to 70
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()
Copy link
Collaborator

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?

Copy link
Contributor Author

@ihorsokhanexoft ihorsokhanexoft May 1, 2025

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

@brianjgeiger brianjgeiger changed the base branch from feature/pbs-25-08 to feature/pbs-25-09 May 2, 2025 13:32
@brianjgeiger brianjgeiger merged commit b2efad2 into CenterForOpenScience:feature/pbs-25-09 May 2, 2025
6 checks passed
ihorsokhanexoft added a commit to ihorsokhanexoft/osf.io that referenced this pull request Jun 4, 2025
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants