Skip to content

Commit

Permalink
BUG make sure mongo can see stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
beckermr committed Feb 28, 2024
1 parent 6e4bbd3 commit 0aa62ea
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions conda_forge_tick/lazy_json_backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def base_url(self, value: str) -> None:
def _ignore_write(cls) -> None:
if cls._write_warned:
return
logger.info(f"Note: Write operations to the GitHub online backend are ignored.")
logger.info("Note: Write operations to the GitHub online backend are ignored.")
cls._write_warned = True

@classmethod
Expand All @@ -219,7 +219,7 @@ def _inform_web_request(cls):
)
if cls._n_requests == 20:
logger.warning(
f"Using the GitHub online backend for making a lot of requests is not recommended.",
"Using the GitHub online backend for making a lot of requests is not recommended.",
)

def transaction_context(self) -> "Iterator[GithubLazyJsonBackend]":
Expand Down Expand Up @@ -294,7 +294,10 @@ def _get_graph_data_mongodb_client_cached(pid):
import pymongo
from pymongo import MongoClient

client = MongoClient(os.environ["MONGODB_CONNECTION_STRING"])
from . import sensitive_env

with sensitive_env() as env:
client = MongoClient(env.get("MONGODB_CONNECTION_STRING", ""))

db = client["cf_graph"]
for hashmap in CF_TICK_GRAPH_DATA_HASHMAPS + ["lazy_json"]:
Expand Down

0 comments on commit 0aa62ea

Please sign in to comment.