fix hashing for upstream normal_sync

This commit is contained in:
Daniel Lovbrotte Olsen 2022-12-09 10:25:25 +01:00
parent 240e550d4c
commit 3bbfebb5c1
1 changed files with 11 additions and 9 deletions

View File

@ -154,9 +154,6 @@ in
in if fedReceivers != [ ] then
lib.genAttrs socketAddresses (_: { })
else config.services.nginx.upstreams.synapse_master.servers;
extraConfig = ''
hash $mxid_localpart consistent;
'';
};
@ -173,12 +170,17 @@ in
};
services.nginx.upstreams.synapse_worker_normal_sync.servers = let
normalSyncers = getWorkersOfType "normal-sync";
socketAddresses = generateSocketAddresses "client" normalSyncers;
in if normalSyncers != [ ] then
lib.genAttrs socketAddresses (_: { })
else config.services.nginx.upstreams.synapse_master.server;
services.nginx.upstreams.synapse_worker_normal_sync = {
servers = let
normalSyncers = getWorkersOfType "normal-sync";
socketAddresses = generateSocketAddresses "client" normalSyncers;
in if normalSyncers != [ ] then
lib.genAttrs socketAddresses (_: { })
else config.services.nginx.upstreams.synapse_master.server;
extraConfig = ''
hash $mxid_localpart consistent;
'';
};