Skip to content

Commit

Permalink
feat: mongo env dsn
Browse files Browse the repository at this point in the history
  • Loading branch information
dartt0n committed Jul 22, 2024
1 parent 87e8f62 commit 08da2d8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
async def app():
load_dotenv()

repo = await MongoDBAdapter.create("mongodb://localhost:27017/randorm")
# repo = MemoryDBAdapter()

telegram_token = os.getenv("TELEGRAM_TOKEN")
if telegram_token is None:
raise RuntimeError("TELEGRAM_TOKEN is not set")
Expand All @@ -47,10 +44,15 @@ async def app():
if redis_dsn is None:
raise RuntimeError("REDIS_DSN is not set")

mongo_dsn = os.getenv("MONGO_DSN")
if mongo_dsn is None:
raise RuntimeError("MONGO_DSN is not set")

telegram_webhook_url = os.getenv("TELEGRAM_WEBHOOK_URL")
if telegram_webhook_url is None:
raise RuntimeError("TELEGRAM_WEBHOOK_URL is not set")

repo = await MongoDBAdapter.create(mongo_dsn)
user_service = UserService(repo)

allocation_service = AllocationService(
Expand Down

0 comments on commit 08da2d8

Please sign in to comment.