Skip to content

Commit

Permalink
ISSUE #78
Browse files Browse the repository at this point in the history
  • Loading branch information
vladyslav-fenchak committed Feb 10, 2022
1 parent 791cd39 commit 7c6aaa5
Show file tree
Hide file tree
Showing 2 changed files with 272 additions and 305 deletions.
7 changes: 4 additions & 3 deletions minos/api_gateway/discovery/database/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class MinosRedisClient:

__slots__ = "address", "port", "password", "redis"

def __init__(self, config: MinosConfig, pool_size: int = 2):
def __init__(self, config: MinosConfig, pool_size: int = 50):
"""Perform initial configuration and connection to Redis"""

address = config.discovery.database.host
Expand Down Expand Up @@ -78,8 +78,9 @@ async def get_all(self) -> list:
return data

async def set_data(self, key: str, data: dict):
await self.redis.set(key, json.dumps(data))
await self.redis.close()
async with self.redis as r:
await r.set(key, json.dumps(data))
# await self.redis.save()

async def update_data(self): # pragma: no cover
"""Update specific value"""
Expand Down
Loading

0 comments on commit 7c6aaa5

Please sign in to comment.