Skip to content
Snippets Groups Projects
Unverified Commit 29d31732 authored by Sébastien Gaya's avatar Sébastien Gaya Committed by GitHub
Browse files

fix cron task name + connect publications to researchers after importing them from authors (#2318)

parent 884ebd63
No related branches found
No related tags found
No related merge requests found
......@@ -12,6 +12,9 @@ module Research::Hal
Research::Hal::Author.find_each do |author|
author.import_research_hal_publications!
end
University::Person.joins(:research_hal_authors).distinct.find_each do |person|
person.connect_research_hal_publications!
end
ensure
unpause_git_sync
end
......
......@@ -33,6 +33,7 @@ module University::Person::WithResearch
scope :with_hal_identifier, -> { where.not(hal_form_identifier: [nil,'']) }
end
# Import HAL publications by retrieving them from API
def import_research_hal_publications!
publications.delete(publications.hal)
hal_authors.each do |author|
......@@ -41,4 +42,13 @@ module University::Person::WithResearch
end
end
# Connect HAL publications from HAL authors without calling the API
def connect_research_hal_publications!
publications.delete(publications.hal)
hal_authors.each do |author|
# TODO manage same researcher in different universities
publications.concat author.publications
end
end
end
{
"jobs": [
{
"command": "0 1 * * * rails auto:update_publications_from_hal",
"command": "0 1 * * * rails auto:update_hal",
"size": "L"
},
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment