|
|
@@ -37,22 +37,22 @@ void *dp_events(void *data) { |
|
|
|
while(1) { |
|
|
|
time_t now = time(NULL); |
|
|
|
|
|
|
|
if ( last_blacklist + DP_BL_CLEAN_INT >= now ) { |
|
|
|
if ( last_blacklist + DP_BL_CLEAN_INT <= now ) { |
|
|
|
dp_blacklist_cleanup(conf); |
|
|
|
last_blacklist=now; |
|
|
|
} |
|
|
|
|
|
|
|
if ( last_accounting + DP_AC_CLEAN_INT >= now ) { |
|
|
|
if ( last_accounting + DP_AC_CLEAN_INT <= now ) { |
|
|
|
dp_accounting_cleanup(conf); |
|
|
|
last_accounting=now; |
|
|
|
} |
|
|
|
|
|
|
|
if ( last_stats + conf->stats_interval >= now ) { |
|
|
|
if ( last_stats + conf->stats_interval <= now ) { |
|
|
|
dp_events_stats(conf); |
|
|
|
last_stats=now; |
|
|
|
} |
|
|
|
|
|
|
|
usleep(100000); /* 100ms */ |
|
|
|
usleep(500000); /* 100ms */ |
|
|
|
} |
|
|
|
|
|
|
|
return NULL; |
|
|
@@ -117,7 +117,7 @@ void dp_events_stats(dp_conf *conf) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
fprintf(fh, "] }\n"); |
|
|
|
fprintf(fh, "], \"timestamp\": %i }\n", (int)time(NULL)); |
|
|
|
|
|
|
|
fclose(fh); |
|
|
|
|