Skip to content

Commit

Permalink
Merge branch 'feat/#104' into feat/#105
Browse files Browse the repository at this point in the history
  • Loading branch information
hyejungg committed Jan 20, 2025
2 parents eabd030 + 7ecfcf2 commit 24411f8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
8 changes: 3 additions & 5 deletions news-scraper-agent/config/env_config.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
from typing import Optional

from dotenv import load_dotenv
from pydantic_settings import BaseSettings, SettingsConfigDict

from typing import Optional

load_dotenv()

Expand All @@ -14,12 +12,12 @@ class Environment(BaseSettings):
# db
MONGO_DB_LOCAL_URI: str
MONGO_DB_DEV_URI: str
MONGO_DB_REAL_URI: str
MONGO_DB_RPOD_URI: str

# kakaoworks
KAWORK_WEBHOOK_LOCAL_URI: str
KAWORK_WEBHOOK_DEV_URI: str
KAWORK_WEBHOOK_REAL_URI: str
KAWORK_WEBHOOK_PROD_URI: str

# langsmith
LANGCHAIN_ENDPOINT: Optional[str] = None
Expand Down
2 changes: 1 addition & 1 deletion news-scraper-agent/config/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def _initialize_logger(self):
formatter = logging.Formatter(fmt="%(name)16s - %(message)s")

# Logger 레벨 설정
self.setLevel(logging.DEBUG if env.PROFILE != "real" else logging.INFO)
self.setLevel(logging.DEBUG if env.PROFILE != "prod" else logging.INFO)

# RichHandler 추가
rich_handler = RichHandler(
Expand Down
2 changes: 1 addition & 1 deletion news-scraper-agent/external/kakaowork/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
HTTP_CONTENT_TYPE = "application/json"

WEBHOOK_URL_MAP = {
"real": env.KAWORK_WEBHOOK_REAL_URI,
"prod": env.KAWORK_WEBHOOK_PROD_URI,
"dev": env.KAWORK_WEBHOOK_DEV_URI,
"local": env.KAWORK_WEBHOOK_LOCAL_URI,
}
Expand Down
7 changes: 3 additions & 4 deletions news-scraper-agent/loader/connect.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
from mongoengine import connect

from config.env_config import env
from config.log import NewsScraperAgentLogger
from models.message import Message
from models.site import Site
from mongoengine import connect

logger = NewsScraperAgentLogger()


def connect_db():
try:
if env.PROFILE == "real":
connect(host=env.MONGO_DB_REAL_URI)
if env.PROFILE == "prod":
connect(host=env.MONGO_DB_PROD_URI)
elif env.PROFILE == "develop":
connect(host=env.MONGO_DB_DEV_URI)
else:
Expand Down

0 comments on commit 24411f8

Please sign in to comment.