Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion ruby/lib/ci/queue.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,13 @@ def from_uri(url, config)
Static
when 'file', nil
File
when 'redis', 'rediss'
when 'redis', 'rediss', 'unix'
# `unix://` URLs are forwarded to the Redis backend as-is;
# redis-client's URL parser accepts the unix:// scheme natively
# and treats the path as the socket path. This lets workloads
# that already run an in-process Redis on a unix socket (Nix
# build sandboxes, hermetic test harnesses, etc.) point ci-queue
# at it without exposing a TCP port.
require 'ci/queue/redis'
Redis
else
Expand Down
5 changes: 5 additions & 0 deletions ruby/test/ci/queue/redis_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,11 @@ def test_initialise_from_rediss_uri
assert_instance_of CI::Queue::Redis::Worker, queue
end

def test_initialise_from_unix_uri
queue = CI::Queue.from_uri('unix:///tmp/redis.sock', config)
assert_instance_of CI::Queue::Redis::Worker, queue
end

def test_first_reserve_at_is_set_on_first_reserve
queue = worker(1)
assert_nil queue.first_reserve_at
Expand Down
Loading