Skip to content

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

@jrhoads

Description

@jrhoads

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions