Commit e1f56089 authored by Pavel Vainerman's avatar Pavel Vainerman

(LogicProcessor): добавил возможность задавать время ожидания готовности SM (--sm-ready-timeout)

parent 708a2f99
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
class LProcessor class LProcessor
{ {
public: public:
LProcessor(); LProcessor( const std::string name="" );
virtual ~LProcessor(); virtual ~LProcessor();
virtual void execute( const string lfile ); virtual void execute( const string lfile );
...@@ -133,6 +133,9 @@ class LProcessor ...@@ -133,6 +133,9 @@ class LProcessor
UniversalInterface ui; UniversalInterface ui;
int sleepTime; int sleepTime;
int smReadyTimeout; /*!< время ожидания готовности SM */
std::string logname;
private: private:
......
...@@ -11,6 +11,7 @@ PassiveLProcessor::PassiveLProcessor( std::string lfile, UniSetTypes::ObjectId o ...@@ -11,6 +11,7 @@ PassiveLProcessor::PassiveLProcessor( std::string lfile, UniSetTypes::ObjectId o
UniSetObject_LT(objId), UniSetObject_LT(objId),
shm(0) shm(0)
{ {
logname = myname;
shm = new SMInterface(shmID,&(UniSetObject_LT::ui),objId,ic); shm = new SMInterface(shmID,&(UniSetObject_LT::ui),objId,ic);
build(lfile); build(lfile);
} }
...@@ -88,9 +89,9 @@ void PassiveLProcessor::sysCommand( UniSetTypes::SystemMessage *sm ) ...@@ -88,9 +89,9 @@ void PassiveLProcessor::sysCommand( UniSetTypes::SystemMessage *sm )
{ {
case SystemMessage::StartUp: case SystemMessage::StartUp:
{ {
if( !shm->waitSMready(10000) ) if( !shm->waitSMready(smReadyTimeout) )
{ {
dlog[Debug::CRIT] << "(ERR): SM not ready. Terminated... " << endl; dlog[Debug::CRIT] << myname << "(ERR): SM not ready. Terminated... " << endl;
raise(SIGTERM); raise(SIGTERM);
return; return;
} }
...@@ -163,17 +164,17 @@ void PassiveLProcessor::setOuts() ...@@ -163,17 +164,17 @@ void PassiveLProcessor::setOuts()
break; break;
default: default:
dlog[Debug::CRIT] << "(LProcessor::setOuts): неподдерживаемый тип iotype=" << it->iotype << endl; dlog[Debug::CRIT] << myname << "(setOuts): неподдерживаемый тип iotype=" << it->iotype << endl;
break; break;
} }
} }
catch( Exception& ex ) catch( Exception& ex )
{ {
dlog[Debug::CRIT] << "(LProcessor::setOuts): " << ex << endl; dlog[Debug::CRIT] << myname << "(setOuts): " << ex << endl;
} }
catch(...) catch(...)
{ {
dlog[Debug::CRIT] << "(LProcessor::setOuts): catch...\n"; dlog[Debug::CRIT] << myname << "(setOuts): catch...\n";
} }
} }
} }
...@@ -195,17 +196,17 @@ void PassiveLProcessor::sigterm( int signo ) ...@@ -195,17 +196,17 @@ void PassiveLProcessor::sigterm( int signo )
break; break;
default: default:
dlog[Debug::CRIT] << "(LProcessor::sigterm): неподдерживаемый тип iotype=" << it->iotype << endl; dlog[Debug::CRIT] << myname << "(sigterm): неподдерживаемый тип iotype=" << it->iotype << endl;
break; break;
} }
} }
catch( Exception& ex ) catch( Exception& ex )
{ {
dlog[Debug::CRIT] << "(LProcessor::sigterm): " << ex << endl; dlog[Debug::CRIT] << myname << "(sigterm): " << ex << endl;
} }
catch(...) catch(...)
{ {
dlog[Debug::CRIT] << "(LProcessor::sigterm): catch...\n"; dlog[Debug::CRIT] << myname << "(sigterm): catch...\n";
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment