diff --git a/mythtv/programs/mythbackend/mainserver.cpp b/mythtv/programs/mythbackend/mainserver.cpp
index 37bc0c1..51fe7f9 100644
a
|
b
|
bool MainServer::TruncateAndClose(ProgramInfo *pginfo, int fd, |
2253 | 2253 | } |
2254 | 2254 | |
2255 | 2255 | int cards = 5; |
2256 | | |
2257 | | MSqlQuery query(MSqlQuery::InitCon()); |
2258 | | query.prepare("SELECT COUNT(cardid) FROM capturecard;"); |
2259 | | if (query.exec() && query.next()) |
2260 | | cards = query.value(0).toInt(); |
| 2256 | { |
| 2257 | MSqlQuery query(MSqlQuery::InitCon()); |
| 2258 | query.prepare("SELECT COUNT(cardid) FROM capturecard;"); |
| 2259 | if (query.exec() && query.next()) |
| 2260 | cards = query.value(0).toInt(); |
| 2261 | } |
2261 | 2262 | |
2262 | 2263 | // Time between truncation steps in milliseconds |
2263 | 2264 | const size_t sleep_time = 500; |
… |
… |
bool MainServer::TruncateAndClose(ProgramInfo *pginfo, int fd, |
2272 | 2273 | .arg(increment / (1024.0 * 1024.0), 0, 'f', 2) |
2273 | 2274 | .arg(sleep_time)); |
2274 | 2275 | |
| 2276 | GetMythDB()->GetDBManager()->PurgeIdleConnections(false); |
| 2277 | |
2275 | 2278 | int count = 0; |
2276 | 2279 | while (fsize > 0) |
2277 | 2280 | { |