mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 16:33:15 +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";
|
engine = "redis";
|
||||||
# Connect to local Redis shard via Unix socket.
|
# Connect to local Redis shard via Unix socket.
|
||||||
redis_address =
|
redis_address =
|
||||||
let
|
let toRedisAddresses = map (name: "${name}:${toString redisPort}"); in
|
||||||
otherNodes = lib.take index nodes ++ lib.drop (index + 1) nodes;
|
toRedisAddresses (lib.take index nodes) ++ [
|
||||||
in
|
|
||||||
map (name: "${name}:${toString redisPort}") otherNodes ++ [
|
|
||||||
"unix://${config.services.redis.servers.centrifugo.unixSocket}"
|
"unix://${config.services.redis.servers.centrifugo.unixSocket}"
|
||||||
];
|
] ++ toRedisAddresses (lib.drop (index + 1) nodes);
|
||||||
usage_stats_disable = true;
|
usage_stats_disable = true;
|
||||||
api_insecure = true;
|
api_insecure = true;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user