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 /logforwarder | |
parent | 64b7c822099d7cda921699e380c4d95608a1ab00 (diff) |
FastOS_Time -> std::chrono.
Diffstat (limited to 'logforwarder')
-rw-r--r-- | logforwarder/src/apps/vespa-logforwarder-start/cf-handler.cpp | 15 | ||||
-rw-r--r-- | logforwarder/src/apps/vespa-logforwarder-start/cf-handler.h | 2 |
2 files changed, 8 insertions, 9 deletions
diff --git a/logforwarder/src/apps/vespa-logforwarder-start/cf-handler.cpp b/logforwarder/src/apps/vespa-logforwarder-start/cf-handler.cpp index af8b527e227..addf9125508 100644 --- a/logforwarder/src/apps/vespa-logforwarder-start/cf-handler.cpp +++ b/logforwarder/src/apps/vespa-logforwarder-start/cf-handler.cpp @@ -13,16 +13,15 @@ #include <vespa/log/log.h> LOG_SETUP(".cf-handler"); -CfHandler::CfHandler() : _subscriber() {} -CfHandler::~CfHandler() -{ -} +CfHandler::CfHandler() = default; + +CfHandler::~CfHandler() = default; void -CfHandler::subscribe(const std::string & configId, uint64_t timeoutMS) +CfHandler::subscribe(const std::string & configId, std::chrono::milliseconds timeout) { - _handle = _subscriber.subscribe<LogforwarderConfig>(configId, timeoutMS); + _handle = _subscriber.subscribe<LogforwarderConfig>(configId, timeout); } namespace { @@ -89,12 +88,12 @@ CfHandler::doConfigure() void CfHandler::check() { - if (_subscriber.nextConfig(0)) { + if (_subscriber.nextConfigNow()) { doConfigure(); } } -constexpr uint64_t CONFIG_TIMEOUT_MS = 30 * 1000; +constexpr std::chrono::milliseconds CONFIG_TIMEOUT_MS(30 * 1000); void CfHandler::start(const char *configId) diff --git a/logforwarder/src/apps/vespa-logforwarder-start/cf-handler.h b/logforwarder/src/apps/vespa-logforwarder-start/cf-handler.h index 0dcf2be7058..0aa977467b5 100644 --- a/logforwarder/src/apps/vespa-logforwarder-start/cf-handler.h +++ b/logforwarder/src/apps/vespa-logforwarder-start/cf-handler.h @@ -12,7 +12,7 @@ private: ChildHandler childHandler; config::ConfigSubscriber _subscriber; config::ConfigHandle<LogforwarderConfig>::UP _handle; - void subscribe(const std::string & configId, uint64_t timeoutMS); + void subscribe(const std::string & configId, std::chrono::milliseconds timeout); void doConfigure(); public: CfHandler(); |