Skip to content

Commit

Permalink
refactor: remove Communicator::Stop function
Browse files Browse the repository at this point in the history
  • Loading branch information
jr0me committed Aug 8, 2024
1 parent 05bf17d commit ac0b6d6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
2 changes: 0 additions & 2 deletions src/agent/communicator/include/communicator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ namespace communicator

void TryReAuthenticate();

void Stop();

std::mutex m_exitMtx;
std::atomic<bool> m_exitFlag = false;

Expand Down
9 changes: 2 additions & 7 deletions src/agent/communicator/src/communicator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ namespace communicator

Communicator::~Communicator()
{
Stop();
std::lock_guard<std::mutex> lock(m_exitMtx);
m_exitFlag = true;
}

boost::beast::http::status Communicator::SendAuthenticationRequest()
Expand Down Expand Up @@ -70,12 +71,6 @@ namespace communicator
return std::max(0L, static_cast<long>(m_tokenExpTimeInSeconds - now_seconds));
}

void Communicator::Stop()
{
std::lock_guard<std::mutex> lock(m_exitMtx);
m_exitFlag = true;
}

boost::asio::awaitable<void> Communicator::GetCommandsFromManager()
{
auto onAuthenticationFailed = [this]()
Expand Down

0 comments on commit ac0b6d6

Please sign in to comment.