Skip to content
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

Investigate double calls to handle server (register_url) on doi registration. #1295

Open
jrhoads opened this issue Dec 5, 2024 · 0 comments

Comments

@jrhoads
Copy link
Contributor

jrhoads commented Dec 5, 2024

NOTE

Doi registration works. It just takes more time to return than it needs to.

Description

We seem to call out to the handle server twice for every DOI we create. The first call ends has a 201 response, and the second a 200

Through the method register_url
https://github.com/datacite/lupo/blob/master/app/models/concerns/helpable.rb#L17
register_url gets called from the Doi method update_url
https://github.com/datacite/lupo/blob/master/app/models/doi.rb#L1841
Which gets called after_commit on creates and updates
https://github.com/datacite/lupo/blob/master/app/models/doi.rb#L145

The register_url method ,after it does its initial call to the handle server, will check to see if the doi attribute minted is null. If so it will then call a database update on the doi
https://github.com/datacite/lupo/blob/master/app/models/concerns/helpable.rb#L69

This triggers another commit, resulting in another call to update_url and thus register_url and a second call to the handle server
(It doesn't continue doing this because the second time through minted is non-null)

We could cut our time in half for DOI creation if we are more guarded about calling register_url

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

No branches or pull requests

1 participant