Skip to content

Commit

Permalink
addressed lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
HarshGandhi-AWS committed Sep 28, 2023
1 parent 726d4d4 commit 72b7af8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
13 changes: 7 additions & 6 deletions source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ void attemptConnection()
try
{
Retry::ExponentialRetryConfig retryConfig = {10 * 1000, 900 * 1000, -1, nullptr};
auto publishLambda = []() -> bool {
auto publishLambda = []() -> bool
{
int connectionStatus = resourceManager.get()->establishConnection(config.config);
if (SharedCrtResourceManager::ABORT == connectionStatus)
{
Expand All @@ -202,8 +203,8 @@ void attemptConnection()
return false;
}
};
std::thread attemptConnectionThread(
[retryConfig, publishLambda] { Retry::exponentialBackoff(retryConfig, publishLambda); });
std::thread attemptConnectionThread([retryConfig, publishLambda]
{ Retry::exponentialBackoff(retryConfig, publishLambda); });
attemptConnectionThread.join();
}
catch (const std::exception &e)
Expand Down Expand Up @@ -237,10 +238,10 @@ namespace Aws
case ClientBaseEventNotification::FEATURE_STOPPED:
{
LOGM_INFO(TAG, "%s has stopped", feature->getName().c_str());
// Stopping DC for ST component
#if defined(DISABLE_MQTT)
// Stopping DC for ST component
#if defined(DISABLE_MQTT)
shutdown();
#endif
#endif
break;
}
default:
Expand Down
14 changes: 7 additions & 7 deletions source/tunneling/SecureTunnelingFeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,15 +272,15 @@ namespace Aws
void SecureTunnelingFeature::OnConnectionShutdown(SecureTunnelingContext *contextToRemove)
{
LOG_DEBUG(TAG, "SecureTunnelingFeature::OnConnectionShutdown");
#if defined(DISABLE_MQTT)
#if defined(DISABLE_MQTT)
this->stop();
#else
auto it =
find_if(mContexts.begin(), mContexts.end(), [&](const unique_ptr<SecureTunnelingContext> &c) {
return c.get() == contextToRemove;
});
#else
auto it = find_if(
mContexts.begin(),
mContexts.end(),
[&](const unique_ptr<SecureTunnelingContext> &c) { return c.get() == contextToRemove; });
mContexts.erase(std::remove(mContexts.begin(), mContexts.end(), *it));
#endif
#endif
}

} // namespace SecureTunneling
Expand Down

0 comments on commit 72b7af8

Please sign in to comment.