Sha256: 146865652c4e7940c7e77f25ea4ab56bef9559e5fadf8ff9d489d2bb14a35a73

Contents?: true

Size: 862 Bytes

Versions: 7

Compression:

Stored size: 862 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_for_running_tests, 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_for_running_tests
          SCENARIO_RUN_TEST_DATA_CACHE_KEY
        end

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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
qa_server-7.2.1 app/cache_processors/qa_server/scenario_run_cache.rb
qa_server-7.2.0 app/cache_processors/qa_server/scenario_run_cache.rb
qa_server-7.1.3 app/cache_processors/qa_server/scenario_run_cache.rb
qa_server-7.1.2 app/cache_processors/qa_server/scenario_run_cache.rb
qa_server-7.1.1 app/cache_processors/qa_server/scenario_run_cache.rb
qa_server-7.1.0 app/cache_processors/qa_server/scenario_run_cache.rb
qa_server-7.0.0 app/cache_processors/qa_server/scenario_run_cache.rb