summary refs log tree commit diff
path: root/fleet/modules
diff options
context:
space:
mode:
authorV <v@unfathomable.blue>2021-08-17 03:14:25 +0200
committerV <v@unfathomable.blue>2021-08-17 05:50:46 +0200
commit1c103737fb4dc998cc14b72d7b10ff538f95d61d (patch)
treec74ddc0063079e2ccf5448cf66026ba57c0979a2 /fleet/modules
parent95f9cef0262185f985a8c1bb81e4d4cb0d0f50d3 (diff)
downloadunf-legacy-1c103737fb4dc998cc14b72d7b10ff538f95d61d.tar.zst
fleet/modules/public-inbox: fix updated descriptions not getting picked up
Stale data just tastes bad, y'know?

Change-Id: I027250bfb6831ef473088e2ee2652df2a8f894a4
Diffstat (limited to 'fleet/modules')
-rw-r--r--fleet/modules/public-inbox.nix4
1 files changed, 3 insertions, 1 deletions
diff --git a/fleet/modules/public-inbox.nix b/fleet/modules/public-inbox.nix
index 32d99f3..c263fad 100644
--- a/fleet/modules/public-inbox.nix
+++ b/fleet/modules/public-inbox.nix
@@ -87,7 +87,6 @@ in {
       wantedBy = [ "public-inbox-watch.service" "multi-user.target" ];
       before = [ "public-inbox-watch.service" ];
 
-      # TODO(V): Add ${pi-config.inboxdir}/description to the reload conditions, since new descriptions don't get picked up after being updated.
       script = concatStrings (mapAttrsToList (inbox: config: let pi-config = public-inbox-config.publicinbox.${inbox}; in ''
         ${pkgs.public-inbox-init-lite}/bin/public-inbox-init-lite ${inbox} ${pi-config.inboxdir} ${head pi-config.address}
         ln -sf ${pkgs.writeText "public-inbox-description" config.description} ${pi-config.inboxdir}/description
@@ -130,6 +129,9 @@ in {
       requires = [ "public-inbox-httpd.socket" ];
       after = [ "public-inbox-httpd.socket" ];
 
+      # Descriptions are cached for the lifetime of the process, so updates require a restart to get picked up.
+      restartTriggers = mapAttrsToList (inbox: config: "${inbox}:${builtins.hashString "sha256" config.description}") cfg.inboxes;
+
       inherit environment;
 
       serviceConfig = {