1
0
Fork 0

DEV: Add memoization to reduce redis calls

Dieser Commit ist enthalten in:
jumagura 2023-06-19 16:52:20 -04:00
Ursprung e7ab0f7143
Commit 298c083624

Datei anzeigen

@ -90,7 +90,7 @@ class ::CustomWizard::CustomField
if attr == 'serializers' && (unsupported = value - CLASSES[klass.to_sym]).length > 0
add_error(I18n.t("#{i18n_key}.unsupported_serializers",
class: klass,
class: klass,
serializers: unsupported.join(", ")
))
end
@ -140,7 +140,7 @@ class ::CustomWizard::CustomField
end
def self.cached_list
::CustomWizard::Cache.wrap(LIST_CACHE_KEY) do
@cached_list ||= ::CustomWizard::Cache.wrap(LIST_CACHE_KEY) do
PluginStoreRow.where(plugin_name: NAMESPACE).map do |record|
create_from_store(record).as_json.with_indifferent_access
end