Run NTP client in the background

This commit is contained in:
Dan Paulat 2025-08-22 20:04:21 -05:00
parent 63e6ba7709
commit 88d968a533
6 changed files with 54 additions and 1 deletions

View 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

View file

@ -0,0 +1,9 @@
#pragma once
namespace scwx::qt::manager::TaskManager
{
void Initialize();
void Shutdown();
} // namespace scwx::qt::manager::TaskManager