main commit
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-10-16 16:30:25 +09:00
parent 91c7e04474
commit 537e7b363f
1146 changed files with 45926 additions and 77196 deletions

View File

@@ -7,13 +7,13 @@ from typing import (
Iterable,
Iterator,
List,
Literal,
Mapping,
NoReturn,
Optional,
Union,
)
from redis.compat import Literal
from redis.crc import key_slot
from redis.exceptions import RedisClusterException, RedisError
from redis.typing import (
@@ -23,7 +23,6 @@ from redis.typing import (
KeysT,
KeyT,
PatternT,
ResponseT,
)
from .core import (
@@ -31,18 +30,21 @@ from .core import (
AsyncACLCommands,
AsyncDataAccessCommands,
AsyncFunctionCommands,
AsyncGearsCommands,
AsyncManagementCommands,
AsyncModuleCommands,
AsyncScriptCommands,
DataAccessCommands,
FunctionCommands,
GearsCommands,
ManagementCommands,
ModuleCommands,
PubSubCommands,
ResponseT,
ScriptCommands,
)
from .helpers import list_or_args
from .redismodules import AsyncRedisModuleCommands, RedisModuleCommands
from .redismodules import RedisModuleCommands
if TYPE_CHECKING:
from redis.asyncio.cluster import TargetNodesT
@@ -223,7 +225,7 @@ class ClusterMultiKeyCommands(ClusterCommandsProtocol):
The keys are first split up into slots
and then an DEL command is sent for every slot
Non-existent keys are ignored.
Non-existant keys are ignored.
Returns the number of keys that were deleted.
For more information see https://redis.io/commands/del
@@ -238,7 +240,7 @@ class ClusterMultiKeyCommands(ClusterCommandsProtocol):
The keys are first split up into slots
and then an TOUCH command is sent for every slot
Non-existent keys are ignored.
Non-existant keys are ignored.
Returns the number of keys that were touched.
For more information see https://redis.io/commands/touch
@@ -252,7 +254,7 @@ class ClusterMultiKeyCommands(ClusterCommandsProtocol):
The keys are first split up into slots
and then an TOUCH command is sent for every slot
Non-existent keys are ignored.
Non-existant keys are ignored.
Returns the number of keys that were unlinked.
For more information see https://redis.io/commands/unlink
@@ -593,7 +595,7 @@ class ClusterManagementCommands(ManagementCommands):
"CLUSTER SETSLOT", slot_id, state, node_id, target_nodes=target_node
)
elif state.upper() == "STABLE":
raise RedisError('For "stable" state please use cluster_setslot_stable')
raise RedisError('For "stable" state please use ' "cluster_setslot_stable")
else:
raise RedisError(f"Invalid slot state: {state}")
@@ -691,6 +693,12 @@ class ClusterManagementCommands(ManagementCommands):
self.read_from_replicas = False
return self.execute_command("READWRITE", target_nodes=target_nodes)
def gears_refresh_cluster(self, **kwargs) -> ResponseT:
"""
On an OSS cluster, before executing any gears function, you must call this command. # noqa
"""
return self.execute_command("REDISGEARS_2.REFRESHCLUSTER", **kwargs)
class AsyncClusterManagementCommands(
ClusterManagementCommands, AsyncManagementCommands
@@ -866,6 +874,7 @@ class RedisClusterCommands(
ClusterDataAccessCommands,
ScriptCommands,
FunctionCommands,
GearsCommands,
ModuleCommands,
RedisModuleCommands,
):
@@ -896,8 +905,8 @@ class AsyncRedisClusterCommands(
AsyncClusterDataAccessCommands,
AsyncScriptCommands,
AsyncFunctionCommands,
AsyncGearsCommands,
AsyncModuleCommands,
AsyncRedisModuleCommands,
):
"""
A class for all Redis Cluster commands