presence stream writer

This commit is contained in:
Daniel Lovbrotte Olsen 2023-02-02 21:04:07 +01:00
parent 07e95170e8
commit 9c7cdcead1
2 changed files with 15 additions and 0 deletions

View File

@ -117,6 +117,7 @@ in
synapse_federation_transaction synapse_worker_federation;
synapse_client_user-dir synapse_worker_user-dir;
synapse_client_presence synapse_worker_stream-presence;
}
# from https://github.com/tswfi/synapse/commit/b3704b936663cc692241e978dce4ac623276b1a6
@ -187,6 +188,14 @@ in
'';
};
services.nginx.upstreams.synapse_worker_stream-presence = {
servers = let
workers = getWorkersOfType "stream-presence";
socketAddresses = generateSocketAddresses "client" workers;
in if workers != { } then
lib.genAttrs socketAddresses (_: { })
else config.services.nginx.upstreams.synapse_master.servers;
};
services.nginx.upstreams.synapse_worker_user-dir = {
servers = let

View File

@ -226,6 +226,7 @@ in {
eventPersisters = mkWorkerCountOption "event-persister";
useUserDirectoryWorker = mkEnableOption "user directory worker";
usePresenceStreamWriter = mkEnableOption "prescence stream writer";
instances = mkOption {
type = types.attrsOf workerInstanceType;
@ -303,6 +304,11 @@ in {
numberOfWorkers = 1;
nameFn = _: "auto-user-dir";
};
}) // (lib.optionalAttrs wcfg.usePresenceStreamWriter {
"stream-presence" = {
numberOfWorkers = 1;
nameFn = _: "auto-stream-presence";
};
});
coerceWorker = { name, value }: if builtins.isInt value then {