Class: ForemanStatistics::TrendCounterJob
- Inherits:
-
ApplicationJob
- Object
- ApplicationJob
- ForemanStatistics::TrendCounterJob
- Defined in:
- app/jobs/foreman_statistics/trend_counter_job.rb
Instance Method Summary collapse
Instance Method Details
#humanized_name ⇒ Object
19 20 21 |
# File 'app/jobs/foreman_statistics/trend_counter_job.rb', line 19 def humanized_name _('Trend Counter Job') end |
#perform(options = {}) ⇒ Object
3 4 5 6 7 8 9 |
# File 'app/jobs/foreman_statistics/trend_counter_job.rb', line 3 def perform( = {}) start_time = Time.zone.now ForemanStatistics::TrendImporter.update! ensure duration = start_time.is_a?(Time) ? Time.zone.now - start_time : 0 self.class.set(wait: [30.minutes - duration, 0].max).perform_later() end |