From 2d26c356cce396631e28ec33e96e63c5a86456f7 Mon Sep 17 00:00:00 2001 From: Nick Anderson Date: Wed, 8 Jul 2026 20:57:58 +0000 Subject: [PATCH] Added timer_policy attribute to classes: promise reference (3.24) Documents the timer_policy attribute on classes: promises (CFE-4681), which controls whether a persistent class restarts its timer when rediscovered. On the 3.24 stream the default is absolute, preserving the historical behavior; the default changed to reset in 3.28.0. Ticket: CFE-4681 --- .../reference/promise-types/classes.markdown | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/content/reference/promise-types/classes.markdown b/content/reference/promise-types/classes.markdown index c6344b5eb..1d9ae0d89 100644 --- a/content/reference/promise-types/classes.markdown +++ b/content/reference/promise-types/classes.markdown @@ -312,6 +312,52 @@ classes: **See also:** [`persistance` classes attribute][classes#persistence], [`persist_time` in classes body][Promise types#persist_time] +### timer_policy + +**Description:** Determines whether a persistent class restarts its counter +when rediscovered. + +When a [`persistence`][classes#persistence] timer is set, `timer_policy` +controls what happens on later runs while the class is still defined (loaded +from the persistent store): + +- `reset` re-evaluates the promise and restarts the timer, so the class keeps + persisting for as long as the policy keeps running and the expression stays + true. +- `absolute` preserves the original expiry. While the class is already defined + the promise is skipped, so the class disappears once the original timer + elapses, regardless of how often the policy runs. + +This is the counterpart of `timer_policy` in the classes body, which has always +defaulted to `reset`. + +**Type:** (menu option) + +**Allowed input range:** `absolute|reset` + +**Default value:** absolute + +**Example:** + +```cf3 +bundle common setclasses +{ + classes: + "cached_class" + expression => "any", + persistence => "120", + timer_policy => "reset"; +} +``` + +**History:** + +- Introduced in CFEngine 3.24.5. +- The default is `absolute`, preserving the historical persistent-class + behavior. The default changed to `reset` in 3.28.0. + +**See also:** [`persistence` classes attribute][classes#persistence], [`timer_policy` in classes body][Promise types#timer_policy], [`persist_time` in classes body][Promise types#persist_time] + ### not **Description:** Evaluate the negation of string expression in normal form