Skip to content

Commit

Permalink
feat: 기본 셋팅
Browse files Browse the repository at this point in the history
  • Loading branch information
taewan2002 committed Feb 15, 2024
1 parent 2f387ad commit 7841bb5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions app/db/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ def get_Base():
def get_SessionLocal():
return SessionLocal

async def get_redis_client() -> aioredis.Redis:
redis = aioredis.from_url(f"redis://localhost:6379/0", encoding="utf-8", decode_responses=True)
try:
yield redis
finally:
await redis.close()
# async def get_redis_client() -> aioredis.Redis:
# redis = aioredis.from_url(f"redis://localhost:6379/0", encoding="utf-8", decode_responses=True)
# try:
# yield redis
# finally:
# await redis.close()

def get_db() -> Session:
db = SessionLocal()
Expand Down
4 changes: 2 additions & 2 deletions app/service/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

class AuthService:

def __init__(self, db: Session = Depends(get_db), redis: aioredis.Redis = Depends(get_redis_client)):
def __init__(self, db: Session = Depends(get_db)):
self.db = db
self.redis = redis

async def create_token(self, nickname: str):
# 페이로드 설정
payload = {
Expand Down

0 comments on commit 7841bb5

Please sign in to comment.