Continue without Redis connection, when it normally fails

By.

min read

My profile

Share this:

Run this code EARLY and use the built in define. Core will do the rest.

	try {
	        new RedisCluster(NULL, WP_REDIS_CLUSTER, 1.5, 1.5, true, WP_REDIS_PASSWORD );
	} catch ( Exception $exception ) {
		define( 'WP_REDIS_DISABLED', true ); // As we experience a fatal error, DISABLE redis NOW
	}
Share this:

Leave a Reply

Your email address will not be published. Required fields are marked *