]> granicus.if.org Git - vnstat/commitdiff
refactoring, remove MAXUPDATEINTERVAL as no longer relevant
authorTeemu Toivola <git@humdi.net>
Thu, 7 Mar 2019 21:19:42 +0000 (23:19 +0200)
committerTeemu Toivola <git@humdi.net>
Thu, 7 Mar 2019 21:19:42 +0000 (23:19 +0200)
src/common.h
src/daemon.c

index 27bec1802fe6ce0a42195d5566b9700e3968f1e9..76182c3081f08b32247c32ec6939546e2d0ec8fa 100644 (file)
@@ -144,12 +144,6 @@ and most can be changed later from the config file.
 /* how many seconds should sampling take by default */
 #define DEFSAMPTIME 5
 
-/* maximum time (minutes) between two updates before traffic */
-/* for that period will be discarded */
-/* set to a little over one hour so that it doesn't break using */
-/* cron.hourly like Gentoo seems to do */
-#define MAXUPDATEINTERVAL 62
-
 /* default query mode */
 /* 0 = normal, 1 = days, 2 = months, 3 = top, 5 = short */
 /* 7 = hours, 8 = xml, 9 = one line, 10 = json */
index 877360d44f9e2e503438b95ab4b234ba79cc371d..15644f00185b6967fc32c012f2d873fd8b13c898 100644 (file)
@@ -524,7 +524,9 @@ int processifinfo(DSTATE *s, datacache **dc)
        }
 
        interval = ifinfo.timestamp - (*dc)->updated;
-       if ( (interval >= 1) && (interval <= (60*MAXUPDATEINTERVAL)) ) {
+       /* maximum configurable update interval is 5 minutes, limit here is set to 6 minutes (360 seconds) */
+       /* in order to be on the safe side and avoid discarding data in case there's some random extra delay */
+       if ( (interval >= 1) && (interval <= 360) ) {
 
                rxchange = countercalc(&(*dc)->currx, &ifinfo.rx, ifinfo.is64bit);
                txchange = countercalc(&(*dc)->curtx, &ifinfo.tx, ifinfo.is64bit);