recyclarr: ensure restart on config change
All checks were successful
Build and Deploy / deploy (push) Successful in 1m36s
All checks were successful
Build and Deploy / deploy (push) Successful in 1m36s
This commit is contained in:
@@ -190,9 +190,19 @@ in
|
||||
};
|
||||
};
|
||||
|
||||
# Re-sync immediately on deploy when the recyclarr config changes
|
||||
# Trigger immediate sync on deploy when recyclarr config changes.
|
||||
# restartTriggers on the oneshot service are unreliable (systemd may
|
||||
# no-op a restart of an inactive oneshot). Instead, embed a config
|
||||
# hash in the timer unit -- NixOS restarts changed timers reliably,
|
||||
# and OnActiveSec fires the sync within seconds.
|
||||
systemd.timers.recyclarr = {
|
||||
timerConfig.OnActiveSec = "5s";
|
||||
unitConfig.X-ConfigHash = builtins.hashString "sha256" (
|
||||
builtins.toJSON config.services.recyclarr.configuration
|
||||
);
|
||||
};
|
||||
|
||||
systemd.services.recyclarr = {
|
||||
restartTriggers = [ (builtins.toJSON config.services.recyclarr.configuration) ];
|
||||
after = [
|
||||
"network-online.target"
|
||||
"radarr.service"
|
||||
|
||||
Reference in New Issue
Block a user