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

@ -9,6 +9,7 @@
#include <scwx/qt/manager/radar_product_manager.hpp>
#include <scwx/qt/manager/resource_manager.hpp>
#include <scwx/qt/manager/settings_manager.hpp>
#include <scwx/qt/manager/task_manager.hpp>
#include <scwx/qt/manager/thread_manager.hpp>
#include <scwx/qt/settings/general_settings.hpp>
#include <scwx/qt/types/qt_types.hpp>
@ -121,6 +122,7 @@ int main(int argc, char* argv[])
// Initialize application
scwx::qt::config::RadarSite::Initialize();
scwx::qt::config::CountyDatabase::Initialize();
scwx::qt::manager::TaskManager::Initialize();
scwx::qt::manager::SettingsManager::Instance().Initialize();
scwx::qt::manager::ResourceManager::Initialize();
@ -181,6 +183,7 @@ int main(int argc, char* argv[])
// Shutdown application
scwx::qt::manager::ResourceManager::Shutdown();
scwx::qt::manager::SettingsManager::Instance().Shutdown();
scwx::qt::manager::TaskManager::Shutdown();
// Shutdown AWS SDK
Aws::ShutdownAPI(awsSdkOptions);

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