Sha256: 5279669fb6aa2ea9947d753056d1add5c2368c76d0c630d9f1e1d33a7b8bf433

Contents?: true

Size: 840 Bytes

Versions: 10

Compression:

Stored size: 840 Bytes

Contents

# frozen_string_literal: true
# Maintain a cache controlling the execution of scenario tests.
module QaServer
  class ScenarioRunCache
    class << self
      include QaServer::CacheKeys

      # Run connection tests
      def run_tests(force: false)
        Rails.cache.fetch(cache_key, expires_in: next_expiry, race_condition_ttl: 30.seconds, force: force) do
          QaServer.config.monitor_logger.debug("(QaServer::ScenarioRunCache) - KICKING OFF TEST RUN (force: #{force})")
          QaServer::MonitorTestsJob.perform_later
          "Test run initiated at #{QaServer::TimeService.current_time}"
        end
      end

    private

      def cache_key
        "QaServer::ScenarioRunCache.run_tests--latest_run_initiated"
      end

      def next_expiry
        QaServer::CacheExpiryService.cache_expiry
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

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