diff --git a/CEP/BB/BBSControl/include/BBSControl/CommandQueue.h b/CEP/BB/BBSControl/include/BBSControl/CommandQueue.h index e43aa78e55e82fca0681699dde7b038041f6d203..e17837f19922e2e039fa089b191d8510e3d055a8 100644 --- a/CEP/BB/BBSControl/include/BBSControl/CommandQueue.h +++ b/CEP/BB/BBSControl/include/BBSControl/CommandQueue.h @@ -95,8 +95,8 @@ namespace LOFAR // Check to see if we're starting a new run. The local controller needs // to do a few extra checks; these checks will be done when \a - // isLocalCtrl is \c true. - bool isNewRun(bool isLocalCtrl) const; + // isGlobalCtrl is \c false. + bool isNewRun(bool isGlobalCtrl) const; private: // CommandQueueTrigger needs to have access to itsConnection, so we make diff --git a/CEP/BB/BBSControl/src/CommandQueue.cc b/CEP/BB/BBSControl/src/CommandQueue.cc index ab70e989a933295bb6c84667327cfd548d7f9507..86ad0391cd947e13e609d6d0f2e6677deea65bf9 100644 --- a/CEP/BB/BBSControl/src/CommandQueue.cc +++ b/CEP/BB/BBSControl/src/CommandQueue.cc @@ -82,10 +82,10 @@ namespace LOFAR string opts("dbname=" + dbname + " user=" + user + " host=" + host + " port=" + port); - try { + try { LOG_DEBUG_STR("Connecting to database using options: " << opts); itsConnection.reset(new pqxx::connection(opts)); - } CATCH_PQXX_AND_RETHROW; + } CATCH_PQXX_AND_RETHROW; } @@ -235,15 +235,15 @@ namespace LOFAR } - bool CommandQueue::isNewRun(bool isLocalCtrl) const + bool CommandQueue::isNewRun(bool isGlobalCtrl) const { LOG_TRACE_LIFETIME(TRACE_LEVEL_COND, ""); // Compose the query. ostringstream query; query << "SELECT * FROM blackboard.is_clean_startup('" - << (isLocalCtrl ? "TRUE" : "FALSE") - << "') AS result"; + << (isGlobalCtrl ? "TRUE" : "FALSE") + << "') AS result"; // Execute the query and return the result. return execQuery(query.str()).getBool("result"); diff --git a/CEP/BB/BBSControl/src/KernelProcessControl.cc b/CEP/BB/BBSControl/src/KernelProcessControl.cc index a295dce207f7f7a8dd66fd4a7144f52924e8338f..d2d8b741d36ecdb4dcdc74f7f2a84dc7da4805fd 100644 --- a/CEP/BB/BBSControl/src/KernelProcessControl.cc +++ b/CEP/BB/BBSControl/src/KernelProcessControl.cc @@ -164,7 +164,7 @@ CommandQueue(globalParameterSet()->getString("BBDB.DBName"))); { case KernelProcessControl::INIT: { - if(!itsCommandQueue->isNewRun(true)) + if(!itsCommandQueue->isNewRun(false)) { LOG_ERROR("Need to recover from an aborted run, but \ recovery has not yet been implemented."); @@ -199,6 +199,7 @@ CommandQueue(globalParameterSet()->getString("BBDB.DBName"))); /* await notification here */ LOG_DEBUG("WAIT state not yet implemented, returning to \ RUN state."); + sleep(3); itsState = KernelProcessControl::RUN; break; }