From 1c103737fb4dc998cc14b72d7b10ff538f95d61d Mon Sep 17 00:00:00 2001 From: V Date: Tue, 17 Aug 2021 03:14:25 +0200 Subject: fleet/modules/public-inbox: fix updated descriptions not getting picked up Stale data just tastes bad, y'know? Change-Id: I027250bfb6831ef473088e2ee2652df2a8f894a4 --- fleet/modules/public-inbox.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'fleet') 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 = { -- cgit 1.4.1