Skip to content

Commit

Permalink
fix: remove .encode() from redis password (#754)
Browse files Browse the repository at this point in the history
close #753
  • Loading branch information
etiennetremel authored Nov 17, 2021
1 parent 9dce1bc commit c122ab6
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 12 deletions.
4 changes: 1 addition & 3 deletions bot/kodiak/entrypoints/ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ async def get_redis() -> asyncio_redis.Pool:
_redis = await asyncio_redis.Pool.create(
host=conf.REDIS_URL.hostname or "localhost",
port=conf.REDIS_URL.port or 6379,
password=(
conf.REDIS_URL.password.encode() if conf.REDIS_URL.password else None
),
password=conf.REDIS_URL.password,
# XXX: which var?
poolsize=conf.USAGE_REPORTING_POOL_SIZE,
ssl=conf.REDIS_URL.scheme == "rediss",
Expand Down
4 changes: 1 addition & 3 deletions bot/kodiak/queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,7 @@ async def get_redis() -> asyncio_redis.Pool:
_redis = await asyncio_redis.Pool.create(
host=conf.REDIS_URL.hostname or "localhost",
port=conf.REDIS_URL.port or 6379,
password=(
conf.REDIS_URL.password.encode() if conf.REDIS_URL.password else None
),
password=conf.REDIS_URL.password,
poolsize=conf.USAGE_REPORTING_POOL_SIZE,
encoder=asyncio_redis.encoders.BytesEncoder(),
ssl=conf.REDIS_URL.scheme == "rediss",
Expand Down
4 changes: 1 addition & 3 deletions bot/kodiak/redis_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ async def create_connection() -> asyncio_redis.Connection:
return await asyncio_redis.Connection.create(
host=conf.REDIS_URL.hostname or "localhost",
port=conf.REDIS_URL.port or 6379,
password=(
conf.REDIS_URL.password.encode() if conf.REDIS_URL.password else None
),
password=conf.REDIS_URL.password,
ssl=conf.REDIS_URL.scheme == "rediss",
db=redis_db,
)
4 changes: 1 addition & 3 deletions bot/kodiak/test_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,9 +266,7 @@ async def setup_redis(github_installation_id: str) -> None:
r = await asyncio_redis.Connection.create(
host=host,
port=port,
password=(
conf.REDIS_URL.password.encode() if conf.REDIS_URL.password else None
),
password=conf.REDIS_URL.password,
)
key = f"kodiak:subscription:{github_installation_id}"
await r.hset(key, "account_id", "D1606A79-A1A1-4550-BA7B-C9ED0D792B1E")
Expand Down

0 comments on commit c122ab6

Please sign in to comment.