mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 12:30:05 +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
|
|
@ -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);
|
||||
|
|
|
|||
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
|
||||
9
scwx-qt/source/scwx/qt/manager/task_manager.hpp
Normal file
9
scwx-qt/source/scwx/qt/manager/task_manager.hpp
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#pragma once
|
||||
|
||||
namespace scwx::qt::manager::TaskManager
|
||||
{
|
||||
|
||||
void Initialize();
|
||||
void Shutdown();
|
||||
|
||||
} // namespace scwx::qt::manager::TaskManager
|
||||
Loading…
Add table
Add a link
Reference in a new issue