0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-22 01:10:28 +01:00

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