summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;