chiark / gitweb /
Log stats at intervals
[innduct.git] / statemc.c
index 27ae8614b40f344d9f674fb9e852633fb90a491b..5adecf95997cd79df2ea2dd3d4eb5746b7274547 100644 (file)
--- a/statemc.c
+++ b/statemc.c
@@ -247,6 +247,10 @@ static void notice_processed(InputFile *ipf, int completed,
        RESULT_COUNTS(RCI_NOTHING,  RCI_TRIPLE_VALS)
        );
 
+  memset(ipf->counts, 0, sizeof(ipf->counts));
+  ipf->readcount_ok= ipf->readcount_blank=
+    ipf->readcount_err= ipf->count_nooffer_missing= 0;
+
   free(inprog);
   free(autodefer);
 
@@ -477,11 +481,16 @@ void spawn_inndcomm_flush(const char *why) { /* Moved => Flushing */
 
 void preterminate(void) {
   if (in_child) return;
+  showstats();
+}
+
+void showstats(void) {
   notice_processed(main_input_file,0,"feedfile","");
   notice_processed(flushing_input_file,0,"flushing","");
   if (backlog_input_file)
     notice_processed(backlog_input_file,0, "backlog file ",
                     backlog_input_file->path);
+  until_stats_log= stats_log_periods;
 }
 
 static int signal_self_pipe[2];