summaryrefslogtreecommitdiff
path: root/lib/input_foreman.ml
diff options
context:
space:
mode:
authorยท๐‘‘๐‘ด๐‘•๐‘‘๐‘ฉ๐‘ค2025-12-23 07:47:58 +0000
committerยท๐‘‘๐‘ด๐‘•๐‘‘๐‘ฉ๐‘ค2025-12-23 07:47:58 +0000
commit750c3fade6d0f83fc3fc1d03a58cd31f5c91ed29 (patch)
tree02a5eb04816a30c7b47373ffe6cf97eae1927f77 /lib/input_foreman.ml
parent904ade574fb0aea79d5861642abe7718f6f1f3d1 (diff)
downloadnixtaml-750c3fade6d0f83fc3fc1d03a58cd31f5c91ed29.tar
nixtaml-750c3fade6d0f83fc3fc1d03a58cd31f5c91ed29.tar.gz
nixtaml-750c3fade6d0f83fc3fc1d03a58cd31f5c91ed29.tar.bz2
nixtaml-750c3fade6d0f83fc3fc1d03a58cd31f5c91ed29.tar.lz
nixtaml-750c3fade6d0f83fc3fc1d03a58cd31f5c91ed29.tar.xz
nixtaml-750c3fade6d0f83fc3fc1d03a58cd31f5c91ed29.tar.zst
nixtaml-750c3fade6d0f83fc3fc1d03a58cd31f5c91ed29.zip
list-stale: guard against is_outdated
Diffstat (limited to 'lib/input_foreman.ml')
-rw-r--r--lib/input_foreman.ml9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/input_foreman.ml b/lib/input_foreman.ml
index 08f4f79..f010cbc 100644
--- a/lib/input_foreman.ml
+++ b/lib/input_foreman.ml
@@ -630,7 +630,14 @@ let list_stale ~env: _ ~sw ~proc_mgr ~domain_count ~names : (unit, error) result
match get_latest ~sw ~proc_mgr input with
| Error err -> Error err
| Ok None -> Ok None
- | Ok (Some new_value) -> Ok (Some (name, new_value))
+ | Ok (Some new_value) ->
+ let is_outdated : string option -> bool =
+ Option.fold ~none: true ~some: (Fun.compose not (String.equal new_value))
+ in
+ if is_outdated input.latest.value then
+ Ok (Some (name, new_value))
+ else
+ Ok None
in
(* only hold the mutex for shared state updates *)
Eio.Mutex.lock result_lock;