Handle retention as a config variable
This commit is contained in:
@@ -29,6 +29,7 @@ char* daemon_banner = "";
|
||||
uint32_t global_backoff = 5;
|
||||
uint32_t web_refresh = 30;
|
||||
uint32_t status_refresh = 30;
|
||||
uint32_t retention = 86400;
|
||||
|
||||
int get_asset(char** buffer, const char* path, size_t* size) {
|
||||
*size = 0;
|
||||
@@ -211,7 +212,7 @@ mxml_node_t* generate_index() {
|
||||
for (; !iterator_equals(&count_it, &peroid_end); iterator_increment(&count_it)) {
|
||||
struct StatusPeroid* peroid = *(struct StatusPeroid**)iterator_get(&count_it);
|
||||
if (earliest_time == 0) earliest_time = peroid->time;
|
||||
else if (peroid->time <= (now - 86400000000)) {
|
||||
else if (peroid->time <= (now - (long)retension * 1000000)) {
|
||||
earliest_time = peroid->time;
|
||||
} else col_count++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user