Ticket #12831: commit-c7dab52

File commit-c7dab52, 873 bytes (added by brian@…, 4 years ago)

patch to emit warning when database ping fails

Line 
1From c7dab526ed9672c4cce2e3784297a100f32493a4 Mon Sep 17 00:00:00 2001
2From: "Brian J. Murrell" <brian@interlinx.bc.ca>
3Date: Wed, 20 Jul 2016 07:35:42 -0400
4Subject: Warn the user if the database ping fails
5
6Since subsequent database operations will fail, but in a rather unobvious
7way.
8
9diff --git a/mythtv/libs/libmyth/mythcontext.cpp b/mythtv/libs/libmyth/mythcontext.cpp
10index 7a934b8..f8e5952 100644
11--- a/mythtv/libs/libmyth/mythcontext.cpp
12+++ b/mythtv/libs/libmyth/mythcontext.cpp
13@@ -696,6 +696,7 @@ QString MythContextPrivate::TestDBconnection(void)
14 
15     if (doPing && !ping(host, 3))  // Fail after trying for 3 seconds
16     {
17+        LOG(VB_GENERAL, LOG_WARN, QString("Pinging to %1 failed, database will be unavailable").arg(host));
18         SilenceDBerrors();
19         err = QObject::tr(
20             "Cannot find (ping) database host %1 on the network",