summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorXavier Roche <xroche@users.noreply.github.com>2012-03-21 20:01:09 +0000
committerXavier Roche <xroche@users.noreply.github.com>2012-03-21 20:01:09 +0000
commita83f0963e86c760c53200da05c310b84cbfb3601 (patch)
tree9576a1b893786d88e3effdb7a2db7ee9be09e33c /src
parentdc0db67742d74b8a4081e51e76a62e3961414147 (diff)
Do not flood logs when stopping mirror after max time has passed
Diffstat (limited to 'src')
-rw-r--r--src/htsback.c12
1 files changed, 7 insertions, 5 deletions
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 */
}