Skip to content

Commit

Permalink
flush every 5 seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
lurume84 committed Apr 25, 2020
1 parent 56a0b8b commit 22f852f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/DesktopApp/Services/DownloadDesktopService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,19 @@ namespace desktop { namespace ui { namespace service {
std::unique_lock<std::mutex> lock(m_mutex);
m_cv.wait(lock);

boost::system::error_code ec;
boost::filesystem::rename(m_path, folder, ec);

if (ec != boost::system::errc::success)
{
core::service::LogService::error("Desktop Upgrade: Could not rename Desktop installer from {} to {}", m_path, folder);
}
else
if(m_path != "")
{
m_path = folder;
boost::system::error_code ec;
boost::filesystem::rename(m_path, folder, ec);

if (ec != boost::system::errc::success)
{
core::service::LogService::error("Desktop Upgrade: Could not rename Desktop installer from {} to {}", m_path, folder);
}
else
{
m_path = folder;
}
}

return m_path;
Expand Down
1 change: 1 addition & 0 deletions src/DesktopCore/System/Agents/LogAgent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ namespace desktop { namespace core { namespace agent {
m_logger = std::make_shared<spdlog::async_logger>("BlingLog", sinks.begin(), sinks.end(), spdlog::thread_pool(), spdlog::async_overflow_policy::block);

spdlog::register_logger(m_logger);
spdlog::flush_every(std::chrono::seconds(5));
}
}
}}}

0 comments on commit 22f852f

Please sign in to comment.