Sha256: 2ff05ec166a043a76de67b075966887479ade5feb0a1be4ceb5a4a5ef4bc206f
Contents?: true
Size: 812 Bytes
Versions: 3
Compression:
Stored size: 812 Bytes
Contents
# frozen_string_literal: true module CI module Queue module Redis class Supervisor < Base def master? false end def total wait_for_master(timeout: config.timeout) redis.get(key('total')).to_i end def build @build ||= CI::Queue::Redis::BuildRecord.new(self, redis, config) end def wait_for_workers return false unless wait_for_master(timeout: config.timeout) yield if block_given? time_left = config.timeout until exhausted? || time_left <= 0 sleep 1 time_left -= 1 yield if block_given? end exhausted? rescue CI::Queue::Redis::LostMaster false end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
ci-queue-0.17.2 | lib/ci/queue/redis/supervisor.rb |
ci-queue-0.17.1 | lib/ci/queue/redis/supervisor.rb |
ci-queue-0.17.0 | lib/ci/queue/redis/supervisor.rb |