Commit 4c2c1f7d authored by Pavel Vainerman's avatar Pavel Vainerman

(Configuration): добавил глобальную настройку для времени игнорирования

повторного сообщения о старте. Увеличил некоторые timeout-ы по умолчанию.
parent fc18aaba
......@@ -158,7 +158,7 @@ namespace uniset
evntPause = conf->getArgPInt("--e-startup-pause", 5000);
activateTimeout = conf->getArgPInt("--activate-timeout", 90000);
activateTimeout = conf->getArgPInt("--activate-timeout", 120000);
sidPulsar = DefaultObjectId;
string p = conf->getArgParam("--pulsar-id", it.getProp("pulsar_id"));
......
......@@ -76,7 +76,7 @@ UNetExchange::UNetExchange(uniset::ObjectId objId, uniset::ObjectId shmId, const
int recvTimeout = conf->getArgPInt("--" + prefix + "-recv-timeout", it.getProp("recvTimeout"), 5000);
int prepareTime = conf->getArgPInt("--" + prefix + "-prepare-time", it.getProp("prepareTime"), 2000);
int evrunTimeout = conf->getArgPInt("--" + prefix + "-evrun-timeout", it.getProp("evrunTimeout"), 15000);
int evrunTimeout = conf->getArgPInt("--" + prefix + "-evrun-timeout", it.getProp("evrunTimeout"), 40000);
int recvpause = conf->getArgPInt("--" + prefix + "-recvpause", it.getProp("recvpause"), 10);
int sendpause = conf->getArgPInt("--" + prefix + "-sendpause", it.getProp("sendpause"), 100);
int updatepause = conf->getArgPInt("--" + prefix + "-updatepause", it.getProp("updatepause"), 100);
......
......@@ -67,7 +67,7 @@ namespace uniset
* Даже если thread = false, но wather не сможет быть "активирован" функция вернёт управление
* с return false.
*/
bool evrun( EvWatcher* w, bool thread = true, size_t waitPrepareTimeout_msec = 15000);
bool evrun( EvWatcher* w, bool thread = true, size_t waitPrepareTimeout_msec = 5000);
/*! \return TRUE - если это был последний EvWatcher и loop остановлен */
bool evstop( EvWatcher* w );
......
......@@ -124,6 +124,7 @@ namespace uniset
timeout_t getHeartBeatTime() const noexcept;
timeout_t getNCReadyTimeout() const noexcept;
timeout_t getStartupIgnoreTimeout() const noexcept;
// dirs
const std::string getConfDir() const noexcept;
......@@ -235,6 +236,7 @@ namespace uniset
timeout_t heartbeat_msec = { 3000 };
timeout_t ncreadytimeout_msec = { 180000 };
timeout_t startupIgnoretimeout_msec = { 5000 };
};
/*! Глобальный указатель на конфигурацию (singleton) */
......
......@@ -687,6 +687,20 @@ namespace uniset
else if( ncreadytimeout_msec == 0 )
ncreadytimeout_msec = 180000;
}
// startup ingore timeout init...
cnode = getNode("StartUpIgnoreTimeout");
if( cnode )
{
UniXML::iterator hit(cnode);
startupIgnoretimeout_msec = hit.getIntProp("msec");
if( startupIgnoretimeout_msec < 0 )
startupIgnoretimeout_msec = UniSetTimer::WaitUpTime;
else if( startupIgnoretimeout_msec == 0 )
startupIgnoretimeout_msec = 5000;
}
}
// -------------------------------------------------------------------------
void Configuration::setLocalNode( const string& nodename )
......@@ -1270,6 +1284,11 @@ namespace uniset
{
return ncreadytimeout_msec;
}
timeout_t Configuration::getStartupIgnoreTimeout() const noexcept
{
return startupIgnoretimeout_msec;
}
// -------------------------------------------------------------------------
const string Configuration::getConfDir() const noexcept
{
......
......@@ -79,6 +79,7 @@ TEST_CASE( "Configuration", "[Configuration]" )
REQUIRE( conf->getCountOfNet() == 1 );
REQUIRE( conf->getRepeatCount() == 3 );
REQUIRE( conf->getRepeatTimeout() == 50 );
REQUIRE( conf->getStartupIgnoreTimeout() == 6000 );
}
SECTION( "Empty Constructor" )
......
......@@ -23,6 +23,7 @@
<HeartBeatTime msec="2000"/>
<NCReadyTimeout msec="60000"/>
<StartUpIgnoreTimeout msec="6000"/>
<!-- Если не указано, то считается текущий каталог -->
<ConfDir name=""/>
......
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