Browse Source

Improved the detection of MySQL Slave status

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@1023 a333f486-631f-4898-b8df-5754b55c2be0
romainq 14 năm trước cách đây
mục cha
commit
2104dbe176
1 tập tin đã thay đổi với 8 bổ sung6 xóa
  1. 8 6
      core/cmdbsource.class.inc.php

+ 8 - 6
core/cmdbsource.class.inc.php

@@ -562,19 +562,21 @@ class CMDBSource
 		{
 			return false;
 		}
-		if ($aRow['Slave_IO_Running'] != 'Yes')
+		if (!isset($aRow['Slave_SQL_Running']))
 		{
 			return false;
 		}
-		if (!isset($aRow['Slave_SQL_Running']))
+
+		// If at least one slave thread is running, then we consider that the slave is enabled
+		if ($aRow['Slave_IO_Running'] == 'Yes')
 		{
-			return false;
+			return true;
 		}
-		if ($aRow['Slave_SQL_Running'] != 'Yes')
+		if ($aRow['Slave_SQL_Running'] == 'Yes')
 		{
-			return false;
+			return true;
 		}
-		return true;
+		return false;
 	}
 }