Skip to content
Snippets Groups Projects
Commit 61e254da authored by Joris van Zwieten's avatar Joris van Zwieten
Browse files

BugID: 1046

- Fixed isNewRun().
parent ebc6b99d
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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");
......
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment