mirror of
https://github.com/fluent/fluentd-ui.git
synced 2026-05-05 19:06:12 +02:00
Prefetch gem updates at booting a server
This commit is contained in:
parent
1817f7569e
commit
612479db42
10
app/workers/gem_update_check.rb
Normal file
10
app/workers/gem_update_check.rb
Normal file
@ -0,0 +1,10 @@
|
||||
class GemUpdateCheck
|
||||
include SuckerPunch::Job
|
||||
workers 16
|
||||
|
||||
def perform(gem_name)
|
||||
SuckerPunch.logger.info "check #{gem_name} latest version"
|
||||
pl = Plugin.new(gem_name: gem_name)
|
||||
pl.latest_version # NOTE: latest_version will cache rubygems.org response
|
||||
end
|
||||
end
|
||||
3
config/initializers/prefetch_gem_updates.rb
Normal file
3
config/initializers/prefetch_gem_updates.rb
Normal file
@ -0,0 +1,3 @@
|
||||
Plugin.installed.each do |pl|
|
||||
GemUpdateCheck.new.async.perform(pl.gem_name)
|
||||
end
|
||||
Loading…
x
Reference in New Issue
Block a user