mirror of
https://bitbucket.org/jsuto/piler.git
synced 2024-12-25 18:20:12 +01:00
purge log fix
This commit is contained in:
parent
74e6da0bdb
commit
ccf6fd14b0
@ -386,14 +386,13 @@ int main(int argc, char **argv){
|
|||||||
purged += purge_messages_without_attachment(&sdata, &data, &cfg);
|
purged += purge_messages_without_attachment(&sdata, &data, &cfg);
|
||||||
purged += purge_messages_with_attachments(&sdata, &data, &cfg);
|
purged += purge_messages_with_attachments(&sdata, &data, &cfg);
|
||||||
|
|
||||||
printf("purged: %d, %ld bytes\n", purged, purged_size);
|
syslog(LOG_INFO, "purged %d messages, %ld bytes", purged, purged_size);
|
||||||
}
|
}
|
||||||
else printf("purge is not allowed by configuration, enable_purge=%d\n", i);
|
else printf("purge is not allowed by configuration, enable_purge=%d\n", i);
|
||||||
|
|
||||||
|
|
||||||
if(purged_size > 100){
|
if(purged_size > 100){
|
||||||
snprintf(buf, sizeof(buf)-1, "UPDATE `%s` SET size = size - %ld", SQL_ATTACHMENT_TABLE, purged_size);
|
snprintf(buf, sizeof(buf)-1, "UPDATE `%s` SET size = size - %ld", SQL_COUNTER_TABLE, purged_size);
|
||||||
printf("archive size is decreased by %ld bytes\n", purged_size);
|
|
||||||
|
|
||||||
if(dry_run == 0) p_query(&sdata, buf);
|
if(dry_run == 0) p_query(&sdata, buf);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user