Skip to content

Commit

Permalink
fix: #19
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel Kraynyukhov committed Sep 4, 2018
1 parent 2d057f8 commit b0baa4d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions include/Deployer.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ namespace LAppS
std::string service_name(service_iterator.key());
const bool auto_start=service_iterator.value()["auto_start"];
if(auto_start)
restart_service(service_name);
start_service(service_name);
}
}

Expand Down Expand Up @@ -303,8 +303,15 @@ namespace LAppS

void start_service(const std::string& service_name)
{
if( LAppSConfig::getInstance()->getLAppSConfig()["services"].find(service_name) ==
LAppSConfig::getInstance()->getLAppSConfig()["services"].end()
){
itc::getLog()->error(__FILE__,__LINE__,"Can't start service %s, - can't find the service descriptor in Config[lapps.json]",service_name.c_str());
return;
}
try{
auto already_exists=::ApplicationRegistry::getInstance()->getByName(service_name);
itc::getLog()->info(__FILE__,__LINE__,"Service %s is already started",service_name.c_str());
return;
}catch(const std::exception& e)
{
Expand All @@ -320,7 +327,7 @@ namespace LAppS
{
if(sname != service_name)
{
itc::getLog()->info(__FILE__,__LINE__,"Service %s is depending on the service: %s.Trying to start subordinate service ...",service_name.c_str(),sname.c_str());
itc::getLog()->info(__FILE__,__LINE__,"Service %s is depending on the service: %s. Trying to start subordinate service ...",service_name.c_str(),sname.c_str());
this->start_service(sname);
}
}
Expand Down

0 comments on commit b0baa4d

Please # to comment.