Class: Patches::TenantRunner
- Inherits:
-
Object
- Object
- Patches::TenantRunner
- Includes:
- TenantRunConcern
- Defined in:
- lib/patches/tenant_runner.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(path: nil, tenants: nil) ⇒ TenantRunner
constructor
A new instance of TenantRunner.
- #perform ⇒ Object
- #tenants ⇒ Object
Methods included from TenantRunConcern
Constructor Details
#initialize(path: nil, tenants: nil) ⇒ TenantRunner
Returns a new instance of TenantRunner.
5 6 7 8 |
# File 'lib/patches/tenant_runner.rb', line 5 def initialize(path: nil, tenants: nil) @path = path @tenants = tenants end |
Instance Attribute Details
#path ⇒ Object
Returns the value of attribute path.
3 4 5 |
# File 'lib/patches/tenant_runner.rb', line 3 def path @path end |
Instance Method Details
#perform ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/patches/tenant_runner.rb', line 10 def perform Patches.logger.info("Patches tenant runner for: #{tenants.join(',')}") tenants.each do |tenant| if parallel? Patches::TenantWorker.perform_async( tenant, path, application_version: Patches::Config.configuration.application_version ) else run(tenant, path) end end end |
#tenants ⇒ Object
25 26 27 |
# File 'lib/patches/tenant_runner.rb', line 25 def tenants @tenants ||= (Apartment.tenant_names || []) end |