Commit 8a042f18 authored by Marco De Marco's avatar Marco De Marco
Browse files

Elapsed time fix

parent fb8d2ecb
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -59,6 +59,7 @@ void ProtocolManager::updateNewList() throw(std::runtime_error)
        << boost::posix_time::to_simple_string(m_lastTimestamp) << endl;

    m_newFileRowset_sp = m_dBManager_sp->retrieveNewFiles(m_lastTimestamp);

    m_newFileRowsetIt = m_newFileRowset_sp->begin();
}

@@ -70,9 +71,8 @@ void ProtocolManager::updateFailedList() throw(std::runtime_error)
    DEBUG_STREAM << "ProtocolManager::updateFailedList()" << endl;

    m_failedFileRowset_sp = m_dBManager_sp->retrieveFailedFiles();
    m_failedFileRowsetIt = m_failedFileRowset_sp->begin();

    m_recoveryModeTime = boost::posix_time::second_clock::local_time();
    m_failedFileRowsetIt = m_failedFileRowset_sp->begin();
}

//==============================================================================
@@ -129,9 +129,13 @@ bool ProtocolManager::isRecoveryTimeElapsed()

    boost::posix_time::time_duration diff = now - m_recoveryModeTime;

    DEBUG_STREAM << "ProtocolManager::isRecoveryTimeElapsed() " << diff.total_seconds()
        << "/" << (int)m_configuration_sp->getRecoveryTime() << endl;

    if(diff.total_seconds() > (int)m_configuration_sp->getRecoveryTime())
    {
        DEBUG_STREAM << "ProtocolManager::isRecoveryTimeElapsed() true" << endl;
        m_recoveryModeTime = now;
        return true;
    }
    else