From 187e37d6d2068b28646fb12a0d89c82886bc1638 Mon Sep 17 00:00:00 2001 From: Daniel Kristjansson Date: Thu, 15 Mar 2012 14:07:00 -0400 Subject: [PATCH] Close DB connections before running jobs. These connections will likely timeout anyway during something like a commflagging or transcode job and if we exit the backend while one of these jobs is running while we still have a DB connection we don't get a clean exit. --- mythtv/libs/libmythtv/jobqueue.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mythtv/libs/libmythtv/jobqueue.cpp b/mythtv/libs/libmythtv/jobqueue.cpp index f706914eb0b..d3218e762c0 100644 --- a/mythtv/libs/libmythtv/jobqueue.cpp +++ b/mythtv/libs/libmythtv/jobqueue.cpp @@ -1987,6 +1987,7 @@ void JobQueue::DoTranscodeThread(int jobID) LOG(VB_JOBQUEUE, LOG_INFO, LOC + QString("Running command: '%1'") .arg(command)); + GetMythDB()->GetDBManager()->CloseDatabases(); uint result = myth_system(command); int status = GetJobStatus(jobID); @@ -2160,6 +2161,7 @@ void JobQueue::DoMetadataLookupThread(int jobID) LOG(VB_JOBQUEUE, LOG_INFO, LOC + QString("Running command: '%1'") .arg(command)); + GetMythDB()->GetDBManager()->CloseDatabases(); retVal = myth_system(command); int priority = LOG_NOTICE; QString comment; @@ -2296,6 +2298,7 @@ void JobQueue::DoFlagCommercialsThread(int jobID) LOG(VB_JOBQUEUE, LOG_INFO, LOC + QString("Running command: '%1'") .arg(command)); + GetMythDB()->GetDBManager()->CloseDatabases(); breaksFound = myth_system(command, kMSLowExitVal); int priority = LOG_NOTICE; QString comment; @@ -2413,6 +2416,7 @@ void JobQueue::DoUserJobThread(int jobID) LOG(VB_JOBQUEUE, LOG_INFO, LOC + QString("Running command: '%1'") .arg(command)); + GetMythDB()->GetDBManager()->CloseDatabases(); uint result = myth_system(command); if ((result == GENERIC_EXIT_DAEMONIZING_ERROR) ||