static void statemc_start_flush(const char *why); /* Normal => Flushing */
static void spawn_inndcomm_flush(const char *why); /* Moved => Flushing */
-static int trigger_flush_ok(void); /* => Flushing,FLUSHING, ret 1; or ret 0 */
+static int trigger_flush_ok(const char *why /* 0 means timeout */);
+ /* => Flushing,FLUSHING, ret 1; or ret 0 */
static void article_done(Article *art, int whichcount);
}
CCMD(flush) {
- int ok= trigger_flush_ok();
+ int ok= trigger_flush_ok("manual request");
if (!ok) fprintf(cc->out,"already flushing (state is %s)\n", sms_names[sms]);
}
spawn_inndcomm_flush(why); /* => Flushing FLUSHING */
}
-static int trigger_flush_ok(void) { /* => Flushing,FLUSHING, ret 1; or ret 0 */
+static int trigger_flush_ok(const char *why) {
switch (sms) {
case sm_NORMAL:
- statemc_start_flush("periodic"); /* Normal => Flushing; => FLUSHING */
- return 1;
+ statemc_start_flush(why ? why : "periodic");
+ return 1; /* Normal => Flushing; => FLUSHING */
case sm_FLUSHFAILED:
- spawn_inndcomm_flush("retry"); /* Moved => Flushing; => FLUSHING */
- return 1;
+ spawn_inndcomm_flush(why ? why : "retry");
+ return 1; /* Moved => Flushing; => FLUSHING */
case sm_SEPARATED:
case sm_DROPPING:
- warn("took too long to complete old feedfile after flush, autodeferring");
+ warn("abandoning old feedfile after flush (%s), autodeferring",
+ why ? why : "took too long to complete");
assert(flushing_input_file);
autodefer_input_file(flushing_input_file);
return 1;
assert(until_flush>=0);
if (until_flush) return;
- int ok= trigger_flush_ok();
+ int ok= trigger_flush_ok(0);
assert(ok);
}