diff options
Diffstat (limited to 'src/FillRequestGroupCommand.cc')
| -rw-r--r-- | src/FillRequestGroupCommand.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/FillRequestGroupCommand.cc b/src/FillRequestGroupCommand.cc index 0c326a44..6ec4151b 100644 --- a/src/FillRequestGroupCommand.cc +++ b/src/FillRequestGroupCommand.cc @@ -42,6 +42,7 @@ #include "LogFactory.h" #include "DownloadContext.h" #include "fmt.h" +#include "wallclock.h" namespace aria2 { @@ -80,6 +81,17 @@ bool FillRequestGroupCommand::execute() } } e_->addRoutineCommand(std::unique_ptr<Command>(this)); + + // let's make sure we come back here every second or so + // if we use the optimize-concurrent-download option + if (rgman->getOptimizeConcurrentDownloads()) { + const auto& now = global::wallclock(); + if (std::chrono::duration_cast<std::chrono::seconds>(lastExecTime.difference(now)) >= 1_s) { + lastExecTime = now; + rgman->requestQueueCheck(); + } + } + return false; } |
