diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2019-11-19 23:22:55 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2019-11-20 21:55:01 +0000 |
commit | cf3b20dba22718b533eac6854cde86b6538958af (patch) | |
tree | 9a0e795cd74d2721140c48012f794298dfef7420 /configd/src | |
parent | 64b7c822099d7cda921699e380c4d95608a1ab00 (diff) |
FastOS_Time -> std::chrono.
Diffstat (limited to 'configd/src')
-rw-r--r-- | configd/src/apps/sentinel/config-handler.cpp | 9 | ||||
-rw-r--r-- | configd/src/apps/sentinel/config-handler.h | 2 | ||||
-rw-r--r-- | configd/src/apps/sentinel/sentinel.cpp | 3 |
3 files changed, 6 insertions, 8 deletions
diff --git a/configd/src/apps/sentinel/config-handler.cpp b/configd/src/apps/sentinel/config-handler.cpp index 19e31755400..3e7b9ef0ea0 100644 --- a/configd/src/apps/sentinel/config-handler.cpp +++ b/configd/src/apps/sentinel/config-handler.cpp @@ -3,10 +3,9 @@ #include "config-handler.h" #include "output-connection.h" -#include <vespa/vespalib/net/simple_metric_snapshot.h> #include <vespa/vespalib/net/socket_address.h> #include <vespa/vespalib/util/exceptions.h> -#include <vespa/fastos/time.h> +#include <vespa/fastos/timestamp.h> #include <string> #include <fcntl.h> #include <sys/wait.h> @@ -121,9 +120,9 @@ ConfigHandler::terminate() } void -ConfigHandler::subscribe(const std::string & configId, uint64_t timeoutMS) +ConfigHandler::subscribe(const std::string & configId, std::chrono::milliseconds timeout) { - _sentinelHandle = _subscriber.subscribe<SentinelConfig>(configId, timeoutMS); + _sentinelHandle = _subscriber.subscribe<SentinelConfig>(configId, timeout); } void @@ -173,7 +172,7 @@ ConfigHandler::doWork() { // Return true if there are any running services, false if not. - if (_subscriber.nextGeneration(0)) { + if (_subscriber.nextGenerationNow()) { doConfigure(); } handleRestarts(); diff --git a/configd/src/apps/sentinel/config-handler.h b/configd/src/apps/sentinel/config-handler.h index 0af19a6363a..463e9e7ce6a 100644 --- a/configd/src/apps/sentinel/config-handler.h +++ b/configd/src/apps/sentinel/config-handler.h @@ -61,7 +61,7 @@ private: public: ConfigHandler(); virtual ~ConfigHandler(); - void subscribe(const std::string & configId, uint64_t timeoutMS); + void subscribe(const std::string & configId, std::chrono::milliseconds timeout); bool terminate(); int doWork(); void updateActiveFdset(fd_set *fds, int *maxNum); diff --git a/configd/src/apps/sentinel/sentinel.cpp b/configd/src/apps/sentinel/sentinel.cpp index 126c59d42f3..b062d7526b6 100644 --- a/configd/src/apps/sentinel/sentinel.cpp +++ b/configd/src/apps/sentinel/sentinel.cpp @@ -1,7 +1,6 @@ // Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/config/common/exceptions.h> -#include <csignal> #include <unistd.h> #include <sys/time.h> #include <vespa/vespalib/util/signalhandler.h> @@ -14,7 +13,7 @@ LOG_SETUP("config-sentinel"); using namespace config; -constexpr uint64_t CONFIG_TIMEOUT_MS = 3 * 60 * 1000; +constexpr std::chrono::milliseconds CONFIG_TIMEOUT_MS(3 * 60 * 1000); static bool stop() { |