X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/38fcd08dda022d0167840fbb65222fe99b75fcf5..d047c1cb9ceecb6e324adf102e5e38e11fe698e1:/apps/workbench/app/controllers/application_controller.rb diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb index a63fe6e21f..5acf9a7351 100644 --- a/apps/workbench/app/controllers/application_controller.rb +++ b/apps/workbench/app/controllers/application_controller.rb @@ -1,3 +1,7 @@ +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: AGPL-3.0 + class ApplicationController < ActionController::Base include ArvadosApiClientHelper include ApplicationHelper @@ -1234,8 +1238,15 @@ class ApplicationController < ActionController::Base @objects_for[obj.name] = obj end else + key_prefix = "request_#{Thread.current.object_id}_#{dataclass.to_s}_" dataclass.where(uuid: uuids).each do |obj| @objects_for[obj.uuid] = obj + if dataclass == Collection + # The collecions#index defaults to "all attributes except manifest_text" + # Hence, this object is not suitable for preloading the find() cache. + else + Rails.cache.write(key_prefix + obj.uuid, obj.as_json) + end end end @objects_for