Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 12 additions & 23 deletions orchagent/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,33 +275,22 @@ int main(int argc, char **argv)

auto orchDaemon = make_shared<OrchDaemon>(&appl_db, &config_db, &state_db);

try
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you also remove the try bracket and the extra indentation as well?

if (!orchDaemon->init())
{
if (!orchDaemon->init())
{
SWSS_LOG_ERROR("Failed to initialize orchstration daemon");
exit(EXIT_FAILURE);
}

/*
* In syncd view comparison solution, apply view has been sent
* immediately after restore is done
*/
if (!WarmStart::isWarmStart())
{
syncd_apply_view();
}

orchDaemon->start();
}
catch (char const *e)
{
SWSS_LOG_ERROR("Exception: %s", e);
SWSS_LOG_ERROR("Failed to initialize orchstration daemon");
exit(EXIT_FAILURE);
}
catch (exception& e)

/*
* In syncd view comparison solution, apply view has been sent
* immediately after restore is done
*/
if (!WarmStart::isWarmStart())
{
SWSS_LOG_ERROR("Failed due to exception: %s", e.what());
syncd_apply_view();
}

orchDaemon->start();

return 0;
}