Skip to content

Commit

Permalink
comment extra code
Browse files Browse the repository at this point in the history
code from benchmark
code from relation_types is not used
include dois is not used
  • Loading branch information
kjgarza committed Jan 1, 2020
1 parent 596ac25 commit ae64ced
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,8 @@

# work = {}
# result = Benchmark.measure do
@work = get_works(id: params["id"])
halt 404 if @work[:errors].present?
# @work = get_works(id: params["id"])
# halt 404 if @work[:errors].present?
# end
# logger.info "[GetWorks] for /works/#{params["id"]} took #{(result.total * 1000).to_i} ms"

Expand All @@ -182,7 +182,7 @@

# events = {}
# result = Benchmark.measure do
events = get_events('page[size]' => 1, 'page[number]' => @page, 'doi' => doi, 'include' => 'dois', 'sort' => 'relation_type_id')
events = get_events('page[size]' => 1, 'page[number]' => @page, 'doi' => doi, 'sort' => 'relation_type_id')
# end
# logger.info "[GetEvents] for /works/#{params["id"]} took #{(result.total * 1000).to_i} ms"

Expand All @@ -191,7 +191,7 @@
@work[:metrics].merge!(citations_histogram: events[:meta].fetch('citationsHistogram', {}))
@work[:metrics].merge!(views_histogram: events[:meta].fetch('viewsHistogram', {}))
@work[:metrics].merge!(downloads_histogram: events[:meta].fetch('downloadsHistogram', {}))
@work[:relation_types] = events[:meta].fetch('relationTypes', [])
# @work[:relation_types] = events[:meta].fetch('relationTypes', [])

# check for existing claims if user is logged in and work is registered with DataCite
if current_user
Expand Down

0 comments on commit ae64ced

Please sign in to comment.