Skip to content

Commit

Permalink
Use env variables for MongoDB URI and DB name
Browse files Browse the repository at this point in the history
  • Loading branch information
Ru Chern Chong committed May 7, 2024
1 parent 0ca39ea commit 1f2bf06
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@


async def update(collection_name, zip_file_name, zip_url, key_fields):
client = MongoClient("mongodb://localhost:27017/")
db = client["local-lta-datasets"]
client = MongoClient(os.environ.get("MONGODB_URI", "mongodb://localhost:27017/"))
db = client[os.environ.get("MONGODB_DB_NAME", "local-lta-datasets")]
collection = db[collection_name]

try:
Expand Down

0 comments on commit 1f2bf06

Please sign in to comment.