PHP Notice: Undefined index: globalr in /wp-content/db.php on line 507
PHP Notice: Trying to access array offset on value of type null in /wp-content/db.php on line 507
PHP Notice: Undefined index: globalr in /wp-content/db.php on line 510
PHP Notice: Undefined index: global__r in /wp-content/db.php on line 519
When defining the get_lag and get_lag_cache functions with the threshold, I get the above error.
`function get_lag_cache($wpdb) {
try {
// Create a new Redis instance
$redis = new Redis();
$redis->connect('127.0.0.1', 6379); // Adjust host and port as needed
function get_lag($wpdb) {
// Query to get the replication lag
$results = $wpdb->get_results("SHOW SLAVE STATUS", ARRAY_A);
if (isset($results[0]['Seconds_Behind_Master'])) {
error_log($results[0]['Seconds_Behind_Master']);
return $results[0]['Seconds_Behind_Master'];
} else {
return false;
}
}`
@dd32 Can you please help with this issue? I am not able to enable a lag monitor because of these warnings.
PHP Notice: Undefined index: globalr in /wp-content/db.php on line 507 PHP Notice: Trying to access array offset on value of type null in /wp-content/db.php on line 507 PHP Notice: Undefined index: globalr in /wp-content/db.php on line 510 PHP Notice: Undefined index: global__r in /wp-content/db.php on line 519
When defining the get_lag and get_lag_cache functions with the threshold, I get the above error.
`function get_lag_cache($wpdb) { try { // Create a new Redis instance $redis = new Redis(); $redis->connect('127.0.0.1', 6379); // Adjust host and port as needed
}
function get_lag($wpdb) { // Query to get the replication lag $results = $wpdb->get_results("SHOW SLAVE STATUS", ARRAY_A); if (isset($results[0]['Seconds_Behind_Master'])) { error_log($results[0]['Seconds_Behind_Master']); return $results[0]['Seconds_Behind_Master']; } else { return false; } }`
@dd32 Can you please help with this issue? I am not able to enable a lag monitor because of these warnings.