Merge pull request #49 from xmindlab-heicode/feat/redis-tls-auth-url
fix(redis/#44): 补回漏合的 keys() 集群 fan-out + Dockerfile COPY benchmark/ (2b0f2fe)
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
.git
|
||||
**/__pycache__
|
||||
**/*.pyc
|
||||
*.md
|
||||
desktop-client
|
||||
test-data
|
||||
artifacts
|
||||
kind-config.yaml
|
||||
.github
|
||||
@@ -9,6 +9,10 @@ RUN pip install --no-cache-dir -r requirements.txt
|
||||
# Copy orchestrator code
|
||||
COPY orchestrator/ ./orchestrator/
|
||||
|
||||
# orchestrator/quality.py imports benchmark.fixtures / benchmark.metrics at startup,
|
||||
# so the package must be present in the image (agent_swarm#44). stdlib-only — no extra pip.
|
||||
COPY benchmark/ ./benchmark/
|
||||
|
||||
# Expose port
|
||||
EXPOSE 8000
|
||||
|
||||
|
||||
@@ -172,7 +172,16 @@ class RedisClient:
|
||||
await self.client.hdel(name, *keys)
|
||||
|
||||
async def keys(self, pattern: str) -> list:
|
||||
"""Get keys matching pattern."""
|
||||
"""Get keys matching pattern.
|
||||
|
||||
In cluster mode KEYS must fan out to every primary and merge — the default
|
||||
routing hits a single node, so on a multi-shard cluster it silently drops
|
||||
keys living on other shards (breaks agent/task enumeration). redis-py merges
|
||||
the per-node results into one flat list.
|
||||
"""
|
||||
if self.cluster:
|
||||
from redis.asyncio.cluster import RedisCluster
|
||||
return await self.client.keys(pattern, target_nodes=RedisCluster.PRIMARIES)
|
||||
return await self.client.keys(pattern)
|
||||
|
||||
async def lpush(self, key: str, *values: str):
|
||||
|
||||
Reference in New Issue
Block a user