From a2463af54cf007072aa433c5c1833958ca6050df Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9s=20J=2E=20D=C3=ADaz?= Date: Wed, 27 May 2009 11:14:40 +0200 Subject: [PATCH] src/utils_cache.c: Fix incorrect checking of persistent thresholds. I attached a patch to solve a problem related with notifications. When a value is missing for a while (2 intervals), a FAILURE notification is raised, and if Persist is false, the notification is repeated each interval, but man page says: If set to false (the default) then a notification is only generated if a value is out of range but the previous value was okay. So, I think that is a bug, if not I'm sorry for the noise :) Regards, Andres P.S.: The problem is only a mixing in if conditions into uc_check_timeout function. Signed-off-by: Florian Forster --- src/utils_cache.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils_cache.c b/src/utils_cache.c index a63c7d1c..2995501a 100644 --- a/src/utils_cache.c +++ b/src/utils_cache.c @@ -303,13 +303,13 @@ int uc_check_timeout (void) sfree (key); cache_free (ce); } - else if (status == 1) /* persist */ + else if (status == 2) /* persist */ { DEBUG ("uc_check_timeout: %s is missing, sending notification.", keys[i]); ce->state = STATE_MISSING; } - else if (status == 2) /* do not persist */ + else if (status == 1) /* do not persist */ { if (ce->state == STATE_MISSING) { -- 2.30.2