mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 20:40:04 +00:00
Run NTP client in the background
This commit is contained in:
parent
63e6ba7709
commit
88d968a533
6 changed files with 54 additions and 1 deletions
29
scwx-qt/source/scwx/qt/manager/task_manager.cpp
Normal file
29
scwx-qt/source/scwx/qt/manager/task_manager.cpp
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
#include <scwx/qt/manager/task_manager.hpp>
|
||||
#include <scwx/network/ntp_client.hpp>
|
||||
#include <scwx/util/logger.hpp>
|
||||
|
||||
namespace scwx::qt::manager::TaskManager
|
||||
{
|
||||
|
||||
static const std::string logPrefix_ = "scwx::qt::manager::task_manager";
|
||||
static const auto logger_ = scwx::util::Logger::Create(logPrefix_);
|
||||
|
||||
static std::shared_ptr<network::NtpClient> ntpClient_ {};
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
logger_->debug("Initialize");
|
||||
|
||||
ntpClient_ = network::NtpClient::Instance();
|
||||
|
||||
ntpClient_->Start();
|
||||
}
|
||||
|
||||
void Shutdown()
|
||||
{
|
||||
logger_->debug("Shutdown");
|
||||
|
||||
ntpClient_->Stop();
|
||||
}
|
||||
|
||||
} // namespace scwx::qt::manager::TaskManager
|
||||
Loading…
Add table
Add a link
Reference in a new issue