mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 06:53:01 +00:00
nixos/tests/centrifugo: fix shards address list order in tests
Redis shards list must be consistent between Centrifugo nodes. Before this change, NixOS tests were using invalid configurtaion since shards[hash(ch)] may select different Redis shard instance on each Centrifugo node. We don’t currently have any tests that exposed this behavior though.
This commit is contained in:
parent
ed8d50fbfc
commit
f27f3cdc10
@ -24,12 +24,10 @@ in
|
||||
engine = "redis";
|
||||
# Connect to local Redis shard via Unix socket.
|
||||
redis_address =
|
||||
let
|
||||
otherNodes = lib.take index nodes ++ lib.drop (index + 1) nodes;
|
||||
in
|
||||
map (name: "${name}:${toString redisPort}") otherNodes ++ [
|
||||
let toRedisAddresses = map (name: "${name}:${toString redisPort}"); in
|
||||
toRedisAddresses (lib.take index nodes) ++ [
|
||||
"unix://${config.services.redis.servers.centrifugo.unixSocket}"
|
||||
];
|
||||
] ++ toRedisAddresses (lib.drop (index + 1) nodes);
|
||||
usage_stats_disable = true;
|
||||
api_insecure = true;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user