Merge pull request #248 from paviliondev/add-logs
Add memoization to reduce redis calls
Dieser Commit ist enthalten in:
Commit
6e0f10ca0d
2 geänderte Dateien mit 4 neuen und 3 gelöschten Zeilen
|
@ -140,7 +140,7 @@ class ::CustomWizard::CustomField
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.cached_list
|
def self.cached_list
|
||||||
::CustomWizard::Cache.wrap(LIST_CACHE_KEY) do
|
@custom_wizard_cached_fields ||= ::CustomWizard::Cache.wrap(LIST_CACHE_KEY) do
|
||||||
PluginStoreRow.where(plugin_name: NAMESPACE).map do |record|
|
PluginStoreRow.where(plugin_name: NAMESPACE).map do |record|
|
||||||
create_from_store(record).as_json.with_indifferent_access
|
create_from_store(record).as_json.with_indifferent_access
|
||||||
end
|
end
|
||||||
|
@ -216,6 +216,7 @@ class ::CustomWizard::CustomField
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.invalidate_cache
|
def self.invalidate_cache
|
||||||
|
@custom_wizard_cached_fields = nil
|
||||||
CustomWizard::Cache.new(LIST_CACHE_KEY).delete
|
CustomWizard::Cache.new(LIST_CACHE_KEY).delete
|
||||||
Discourse.clear_readonly!
|
Discourse.clear_readonly!
|
||||||
Discourse.request_refresh!
|
Discourse.request_refresh!
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
# name: discourse-custom-wizard
|
# name: discourse-custom-wizard
|
||||||
# about: Forms for Discourse. Better onboarding, structured posting, data enrichment, automated actions and much more.
|
# about: Forms for Discourse. Better onboarding, structured posting, data enrichment, automated actions and much more.
|
||||||
# version: 2.4.6
|
# version: 2.4.7
|
||||||
# authors: Angus McLeod, Faizaan Gagan, Robert Barrow, Keegan George, Kaitlin Maddever
|
# authors: Angus McLeod, Faizaan Gagan, Robert Barrow, Keegan George, Kaitlin Maddever, Juan Marcos Gutierrez Ramos
|
||||||
# url: https://github.com/paviliondev/discourse-custom-wizard
|
# url: https://github.com/paviliondev/discourse-custom-wizard
|
||||||
# contact_emails: development@pavilion.tech
|
# contact_emails: development@pavilion.tech
|
||||||
# subscription_url: https://coop.pavilion.tech
|
# subscription_url: https://coop.pavilion.tech
|
||||||
|
|
Laden …
In neuem Issue referenzieren