From a83f0963e86c760c53200da05c310b84cbfb3601 Mon Sep 17 00:00:00 2001 From: Xavier Roche Date: Wed, 21 Mar 2012 20:01:09 +0000 Subject: Do not flood logs when stopping mirror after max time has passed --- src/htsback.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/htsback.c b/src/htsback.c index fae9bbc..1a52500 100644 --- a/src/htsback.c +++ b/src/htsback.c @@ -3823,12 +3823,14 @@ int back_checkmirror(httrackp* opt) { } // Check max time if ((opt->maxtime>0) && ((time_local()-HTS_STAT.stat_timestart)>opt->maxtime)) { - if (opt->log) { - fprintf(opt->log,"More than %d seconds passed.. giving up"LF,opt->maxtime); - test_flush; - } - /* cancel mirror smoothly */ + if (!opt->state.stop) { /* not yet stopped */ + if (opt->log) { + fprintf(opt->log,"More than %d seconds passed.. giving up"LF,opt->maxtime); + test_flush; + } + /* cancel mirror smoothly */ hts_request_stop(opt, 0); + } } return 1; /* Ok, go on */ } -- cgit v1.2.3