summaryrefslogtreecommitdiffstats
path: root/storage
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2019-08-26 07:22:19 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2019-08-26 07:22:19 +0000
commit342e8e9753386b3e3e3d9a823723df63b8971308 (patch)
tree27969ec412e91fce6d2d27bdf09522c35bc624cf /storage
parent78133f8c95b11b460aa4fd9ad89bd00bb716c6f8 (diff)
Avoid calling time(nullptr)
Diffstat (limited to 'storage')
-rw-r--r--storage/src/vespa/storage/config/distributorconfiguration.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/storage/src/vespa/storage/config/distributorconfiguration.cpp b/storage/src/vespa/storage/config/distributorconfiguration.cpp
index 294ce56f536..e6d9ce05d3e 100644
--- a/storage/src/vespa/storage/config/distributorconfiguration.cpp
+++ b/storage/src/vespa/storage/config/distributorconfiguration.cpp
@@ -8,6 +8,8 @@
#include <vespa/log/log.h>
LOG_SETUP(".distributorconfiguration");
+using namespace std::chrono;
+
namespace storage {
DistributorConfiguration::DistributorConfiguration(StorageComponent& component)
@@ -38,7 +40,7 @@ DistributorConfiguration::DistributorConfiguration(StorageComponent& component)
_minimumReplicaCountingMode(ReplicaCountingMode::TRUSTED)
{ }
-DistributorConfiguration::~DistributorConfiguration() { }
+DistributorConfiguration::~DistributorConfiguration() = default;
namespace {
@@ -60,8 +62,7 @@ DistributorConfiguration::containsTimeStatement(const std::string& documentSelec
{
TimeVisitor visitor;
try {
- document::select::Parser parser(*_component.getTypeRepo(),
- _component.getBucketIdFactory());
+ document::select::Parser parser(*_component.getTypeRepo(), _component.getBucketIdFactory());
std::unique_ptr<document::select::Node> node = parser.parse(documentSelection);
node->visit(visitor);
@@ -123,7 +124,7 @@ DistributorConfiguration::configure(const vespa::config::content::core::StorDist
// Always changes.
_lastGarbageCollectionChange = 1;
} else if (_garbageCollectionSelection != config.garbagecollection.selectiontoremove) {
- _lastGarbageCollectionChange = time(NULL);
+ _lastGarbageCollectionChange = duration_cast<seconds>(system_clock::now().time_since_epoch()).count();
}
_garbageCollectionSelection = config.garbagecollection.selectiontoremove;