mirror of
https://github.com/fluent/fluentd-ui.git
synced 2026-05-05 19:06:12 +02:00
Add NOTE for cache design
This commit is contained in:
parent
c40628fd6d
commit
a36e372086
@ -13,7 +13,10 @@ module FluentGem
|
||||
end
|
||||
|
||||
def list
|
||||
Rails.cache.fetch(LIST_CACHE_KEY) do
|
||||
# NOTE: gem list is heavyly used from anywhere in 1 request, if not caching, user experience to be bad
|
||||
# but long living caching causes mismatch with actual status e.g. user install plugin from console (without fluentd-ui)
|
||||
# So our decision is that cache `gem list` in 3 seconds
|
||||
Rails.cache.fetch(LIST_CACHE_KEY, expires_in: 3.seconds) do
|
||||
output = `#{gem} list`
|
||||
unless $?.exitstatus.zero?
|
||||
raise GemError, "failed command: `#{gem} list`"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user