Module: check_mk
Branch: master
Commit: 326447012547dfe950186313fef59c84f4f89277
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=326447012547df…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri May 17 13:15:18 2013 +0200
EC: more intelligent TP caching
---
mkeventd/bin/mkeventd | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mkeventd/bin/mkeventd b/mkeventd/bin/mkeventd
index 67289e8..718db13 100755
--- a/mkeventd/bin/mkeventd
+++ b/mkeventd/bin/mkeventd
@@ -259,7 +259,7 @@ g_last_timeperiod_update = 0
def update_timeperiods():
global g_timeperiods, g_last_timeperiod_update
- if g_timeperiods != None and time.time() < g_last_config_reload + 60:
+ if g_timeperiods != None and int(time.time()) / 60 == g_last_timeperiod_update:
return # only update once a minute
log("Updating timeperiod information")
@@ -274,7 +274,7 @@ def update_timeperiods():
for tpname, alias, isin in table:
new_timeperiods[tpname] = (alias, isin == '1' and True or False)
g_timeperiods = new_timeperiods
- g_last_timeperiod_update = time.time()
+ g_last_timeperiod_update = int(time.time()) / 60
except Exception, e:
log("Cannot update timeperiod information: %s" % e)
if opt_debug: