Sha256: 666323257f30b0b6d2c0cb1db094e0ee37100ffeb47f771dd15cf64f14b4b016

Contents?: true

Size: 971 Bytes

Versions: 10

Compression:

Stored size: 971 Bytes

Contents

# frozen_string_literal: true
# Job to generate the graph of historical test runs per authority.
module QaServer
  class HistoryGraphJob < ApplicationJob
    queue_as :default

    class_attribute :graphing_service
    self.graphing_service = QaServer::HistoryGraphingService

    def perform(data:)
      # checking active_job_id? prevents race conditions for long running jobs
      generate_graph(data) if QaServer::JobIdCache.active_job_id?(job_key: job_key, job_id: job_id)
    end

  private

    def generate_graph(data)
      QaServer.config.monitor_logger.debug("(#{self.class}##{__method__}-#{job_id}) - GENERATING historical summary graph")
      graphing_service.generate_graph(data)
      QaServer.config.monitor_logger.debug("(#{self.class}##{__method__}-#{job_id}) COMPLETED historical summary graph generation")
      QaServer::JobIdCache.reset_job_id(job_key: job_key)
    end

    def job_key
      "QaServer::HistoryGraphJob--job_id"
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
qa_server-8.0.1 app/jobs/qa_server/history_graph_job.rb
qa_server-7.9.2 app/jobs/qa_server/history_graph_job.rb
qa_server-7.9.1 app/jobs/qa_server/history_graph_job.rb
qa_server-7.9.0 app/jobs/qa_server/history_graph_job.rb
qa_server-7.8.0 app/jobs/qa_server/history_graph_job.rb
qa_server-7.7.1 app/jobs/qa_server/history_graph_job.rb
qa_server-7.7.0 app/jobs/qa_server/history_graph_job.rb
qa_server-7.6.0 app/jobs/qa_server/history_graph_job.rb
qa_server-7.5.1 app/jobs/qa_server/history_graph_job.rb
qa_server-7.5.0 app/jobs/qa_server/history_graph_job.rb