-
Notifications
You must be signed in to change notification settings - Fork 8
Description
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