summaryrefslogtreecommitdiff
path: root/src/AbstractCommand.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2015-06-09 03:59:47 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2015-06-09 03:59:47 +0900
commit2448a8660b1daa6ba9fced4b637c7c7468782aca (patch)
tree876d7447b3bdf86115a7ab9adb6023a9215c846a /src/AbstractCommand.cc
parent2874f6ab095a30a4d297cdc85fa3730bec41b1c2 (diff)
parentce89e26e558674276c29d3598a02a56bd8e95d6c (diff)
Merge branch 'chrono'
Diffstat (limited to 'src/AbstractCommand.cc')
-rw-r--r--src/AbstractCommand.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/AbstractCommand.cc b/src/AbstractCommand.cc
index ba1297bc..ae7f5b2f 100644
--- a/src/AbstractCommand.cc
+++ b/src/AbstractCommand.cc
@@ -237,7 +237,8 @@ bool AbstractCommand::execute()
if (req_ && fileEntry_->getLength() > 0 &&
e_->getRequestGroupMan()->getMaxOverallDownloadSpeedLimit() == 0 &&
requestGroup_->getMaxDownloadSpeedLimit() == 0 &&
- serverStatTimer_.difference(global::wallclock()) >= 10) {
+ serverStatTimer_.difference(global::wallclock()) >=
+ std::chrono::seconds(10)) {
serverStatTimer_ = global::wallclock();
std::vector<std::pair<size_t, std::string>> usedHosts;
if (getOption()->getAsBool(PREF_SELECT_LEAST_USED_HOST)) {
@@ -284,7 +285,7 @@ bool AbstractCommand::execute()
A2_LOG_DEBUG("All segments are ignored.");
// This will execute other idle Commands and let them
// finish quickly.
- e_->setRefreshInterval(0);
+ e_->setRefreshInterval(std::chrono::milliseconds(0));
return true;
}
@@ -386,7 +387,8 @@ bool AbstractCommand::execute()
}
Timer wakeTime(global::wallclock());
- wakeTime.advance(getOption()->getAsInt(PREF_RETRY_WAIT));
+ wakeTime.advance(
+ std::chrono::seconds(getOption()->getAsInt(PREF_RETRY_WAIT)));
req_->setWakeTime(wakeTime);
return prepareForRetry(0);
}
@@ -401,7 +403,7 @@ bool AbstractCommand::execute()
A2_LOG_ERROR_EX(EX_EXCEPTION_CAUGHT, err);
}
requestGroup_->setHaltRequested(true);
- getDownloadEngine()->setRefreshInterval(0);
+ getDownloadEngine()->setRefreshInterval(std::chrono::milliseconds(0));
return true;
}
}
@@ -457,7 +459,7 @@ bool AbstractCommand::prepareForRetry(time_t wait)
}
else {
// We don't use wait so that Command can be executed by
- // DownloadEngine::setRefreshInterval(0).
+ // DownloadEngine::setRefreshInterval(std::chrono::milliseconds(0)).
command->setStatus(Command::STATUS_INACTIVE);
}
e_->addCommand(std::move(command));