nginx: make upstream generator check empty attrset rather than empty list
This commit is contained in:
parent
43dbc17526
commit
f42306e0a2
|
@ -153,7 +153,7 @@ in
|
||||||
servers = let
|
servers = let
|
||||||
fedReceivers = getWorkersOfType "fed-receiver";
|
fedReceivers = getWorkersOfType "fed-receiver";
|
||||||
socketAddresses = generateSocketAddresses "federation" fedReceivers;
|
socketAddresses = generateSocketAddresses "federation" fedReceivers;
|
||||||
in if fedReceivers != [ ] then
|
in if fedReceivers != { } then
|
||||||
lib.genAttrs socketAddresses (_: { })
|
lib.genAttrs socketAddresses (_: { })
|
||||||
else config.services.nginx.upstreams.synapse_master.servers;
|
else config.services.nginx.upstreams.synapse_master.servers;
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
|
@ -166,7 +166,7 @@ in
|
||||||
servers = let
|
servers = let
|
||||||
initialSyncers = getWorkersOfType "initial-sync";
|
initialSyncers = getWorkersOfType "initial-sync";
|
||||||
socketAddresses = generateSocketAddresses "client" initialSyncers;
|
socketAddresses = generateSocketAddresses "client" initialSyncers;
|
||||||
in if initialSyncers != [ ] then
|
in if initialSyncers != { } then
|
||||||
lib.genAttrs socketAddresses (_: { })
|
lib.genAttrs socketAddresses (_: { })
|
||||||
else config.services.nginx.upstreams.synapse_master.servers;
|
else config.services.nginx.upstreams.synapse_master.servers;
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
|
@ -179,7 +179,7 @@ in
|
||||||
servers = let
|
servers = let
|
||||||
normalSyncers = getWorkersOfType "normal-sync";
|
normalSyncers = getWorkersOfType "normal-sync";
|
||||||
socketAddresses = generateSocketAddresses "client" normalSyncers;
|
socketAddresses = generateSocketAddresses "client" normalSyncers;
|
||||||
in if normalSyncers != [ ] then
|
in if normalSyncers != { } then
|
||||||
lib.genAttrs socketAddresses (_: { })
|
lib.genAttrs socketAddresses (_: { })
|
||||||
else config.services.nginx.upstreams.synapse_master.servers;
|
else config.services.nginx.upstreams.synapse_master.servers;
|
||||||
extraConfig = ''
|
extraConfig = ''
|
||||||
|
@ -192,7 +192,7 @@ in
|
||||||
servers = let
|
servers = let
|
||||||
workers = getWorkersOfType "user-dir";
|
workers = getWorkersOfType "user-dir";
|
||||||
socketAddresses = generateSocketAddresses "client" workers;
|
socketAddresses = generateSocketAddresses "client" workers;
|
||||||
in if workers != [ ] then
|
in if workers != { } then
|
||||||
lib.genAttrs socketAddresses (_: { })
|
lib.genAttrs socketAddresses (_: { })
|
||||||
else config.services.nginx.upstreams.synapse_master.servers;
|
else config.services.nginx.upstreams.synapse_master.servers;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue