Skip to content

Configure Periodic Checks

In cluster mode, Valkey GLIDE periodically checks the cluster topology to detect changes and refreshes its internal slot map when a change is found. Periodic checks are enabled by default with a 60 second interval. You can keep the default, set a custom interval, or disable them.

OptionDescriptionHow to set it
Enabled (Default)Runs topology checks at the default 60 second interval.Leave periodicChecks unset.
Manual IntervalRuns topology checks at a custom interval.Set periodicChecks to a manual interval with a duration in seconds.
DisabledTurns off periodic checks. The client only refreshes topology on-demand in response to redirection errors.Set periodicChecks to disabled.

The example below sets a custom interval of 30 seconds. Each snippet also shows, as a comment, how to disable periodic checks instead.

from glide import (
GlideClusterClient,
GlideClusterClientConfiguration,
NodeAddress,
PeriodicChecksManualInterval,
PeriodicChecksStatus,
)
addresses = [NodeAddress(host="address.example.com", port=6379)]
client_config = GlideClusterClientConfiguration(
addresses,
periodic_checks=PeriodicChecksManualInterval(duration_in_sec=30),
# To disable instead: periodic_checks=PeriodicChecksStatus.DISABLED
)
client = await GlideClusterClient.create(client_config)