rotate health log at 10000 entries by default; properly calculate the max_unique_id and max_alarm_id taking into account both files: current and old
Costa Tsaousis (ktsaou) committed
Oct 16, 2016 at 20:13 UTC
a8423ad44411e9298ff746a9d255262ca9efaedf
1 file changed
+2
-2
src/health.c
+2
-2
@@ -51,7 +51,7 @@ static inline void health_log_rotate(void) {
51
static size_t rotate_every = 0;
52
53
if(unlikely(rotate_every == 0)) {
54
- rotate_every = (size_t)config_get_number("health", "rotate log every lines", 100);
54
+ rotate_every = (size_t)config_get_number("health", "rotate log every lines", 10000);
55
if(rotate_every < 100) rotate_every = 100;
56
}
57
@@ -140,7 +140,7 @@ static inline void health_alarm_log_save(RRDHOST *host, ALARM_ENTRY *ae) {
140
}
141
142
static inline ssize_t health_alarm_log_read(RRDHOST *host, FILE *fp, const char *filename) {
143
- uint32_t max_unique_id = 0, max_alarm_id = 0;
143
+ static uint32_t max_unique_id = 0, max_alarm_id = 0;
144
ssize_t loaded = -1, updated = -1, errored = -1, duplicate = -1;
145
146
errno = 0;