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