diff --git a/app/controllers/dois_controller.rb b/app/controllers/dois_controller.rb index 70130031a..c28b41134 100644 --- a/app/controllers/dois_controller.rb +++ b/app/controllers/dois_controller.rb @@ -185,8 +185,6 @@ def index format.any(:bibtex, :citeproc, :codemeta, :crosscite, :datacite, :datacite_json, :jats, :ris, :csv, :schema_org) { render request.format.to_sym => response.records.to_a } end rescue Elasticsearch::Transport::Transport::Errors::BadRequest => exception - Raven.capture_exception(exception) - message = JSON.parse(exception.message[6..-1]).to_h.dig("error", "root_cause", 0, "reason") render json: { "errors" => { "title" => message }}.to_json, status: :bad_request diff --git a/app/models/concerns/indexable.rb b/app/models/concerns/indexable.rb index eadb1b2b3..d1ddc9583 100644 --- a/app/models/concerns/indexable.rb +++ b/app/models/concerns/indexable.rb @@ -108,6 +108,10 @@ def query(query, options={}) from = 0 search_after = [options.dig(:page, :cursor)] sort = [{ _id: { order: 'asc' }}] + elsif self.name == "Activity" && options.dig(:page, :cursor).present? + from = 0 + search_after = [options.dig(:page, :cursor)] + sort = [{ created: { order: 'asc' }}] else from = (options.dig(:page, :number) - 1) * options.dig(:page, :size) search_after = nil diff --git a/config/application.rb b/config/application.rb index bd7b0b127..ccde6de10 100644 --- a/config/application.rb +++ b/config/application.rb @@ -77,6 +77,7 @@ class Application < Rails::Application logger = ActiveSupport::Logger.new(STDOUT) logger.formatter = config.log_formatter config.logger = ActiveSupport::TaggedLogging.new(logger) + config.log_level = ENV['LOG_LEVEL'].to_sym # configure caching config.cache_store = :dalli_store, nil, { :namespace => ENV['APPLICATION'] } diff --git a/config/initializers/lograge.rb b/config/initializers/lograge.rb index 16598d544..85ea987cf 100644 --- a/config/initializers/lograge.rb +++ b/config/initializers/lograge.rb @@ -10,7 +10,6 @@ event.payload.inspect.length > 100000 end config.lograge.base_controller_class = 'ActionController::API' - config.log_level = ENV['LOG_LEVEL'].to_sym config.lograge.custom_options = lambda do |event| exceptions = %w(controller action format id)