--- smsdaemon/SmsDaemon.cpp 2008/06/16 11:57:48 94 +++ smsdaemon/SmsDaemon.cpp 2008/12/06 15:13:34 128 @@ -19,7 +19,6 @@ using namespace std; - void SmsDaemon::CreateLogMessage(SMS& sms,bool hasPlugin) { ostringstream os; @@ -33,6 +32,14 @@ void SmsDaemon::CheckSms() { + const int INTERVAL = 1000; //no of milliseconds between sms checks + timeval now = Util::GetTimeOfDay(); + + if ( Util::mTimeDiff(_lastSmsCheck,now) < INTERVAL) + return; + + _lastSmsCheck = now; + Common* cmn = Common::instance(); PluginManager* manager = cmn->GetPluginManager(); @@ -81,7 +88,7 @@ if (cmn->isDebug && kbhit()) break; - Util::Sleep(10); + Util::Sleep(100); } } @@ -92,10 +99,11 @@ cmn->daemonStart = time(0); + _lastSmsCheck = Util::GetTimeOfDay(); cmn->logMessage("--------------------------------"); cmn->logMessage( VERSION ); - cmn->logMessage( SVNVER ); + cmn->logMessage( SVNVERSION ); cmn->GetTaskManager()->LoadTasks(); cmn->GetPluginManager()->LoadPlugins();