Class: Federails::Maintenance::HostsUpdater
- Inherits:
-
Object
- Object
- Federails::Maintenance::HostsUpdater
- Defined in:
- lib/federails/maintenance/hosts_updater.rb
Class Method Summary collapse
-
.run(cache_interval: nil) ⇒ Object
Update information for all known hosts, and complete if some are missing.
Class Method Details
.run(cache_interval: nil) ⇒ Object
Update information for all known hosts, and complete if some are missing
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/federails/maintenance/hosts_updater.rb', line 6 def run(cache_interval: nil) cache_interval ||= Federails::Configuration.remote_entities_cache_duration domains = Federails::Actor.distant.distinct(:server).pluck(:server) + Federails::Host.pluck(:domain) domains.uniq! domains.each do |domain| Federails::Host.create_or_update domain, min_update_interval: cache_interval end end |