add logger.debug for mongo_impl get_by_mode_and_id()
This commit is contained in:
@@ -45,7 +45,9 @@ class MongoKVStorage(BaseKVStorage):
|
||||
for mode, items in data.items():
|
||||
for k, v in tqdm_async(items.items(), desc="Upserting"):
|
||||
key = f"{mode}_{k}"
|
||||
result = self._data.update_one({"_id": key}, {"$setOnInsert": v}, upsert=True)
|
||||
result = self._data.update_one(
|
||||
{"_id": key}, {"$setOnInsert": v}, upsert=True
|
||||
)
|
||||
if result.upserted_id:
|
||||
logger.debug(f"\nInserted new document with key: {key}")
|
||||
data[mode][k]["_id"] = key
|
||||
@@ -61,7 +63,7 @@ class MongoKVStorage(BaseKVStorage):
|
||||
v = self._data.find_one({"_id": mode + "_" + id})
|
||||
if v:
|
||||
res[id] = v
|
||||
print(f"find one by:{id}")
|
||||
logger.debug(f"llm_response_cache find one by:{id}")
|
||||
return res
|
||||
else:
|
||||
return None
|
||||
|
@@ -48,7 +48,11 @@ class Neo4JStorage(BaseGraphStorage):
|
||||
URI, auth=(USERNAME, PASSWORD)
|
||||
)
|
||||
_database_name = "home database" if DATABASE is None else f"database {DATABASE}"
|
||||
with GraphDatabase.driver(URI, auth=(USERNAME, PASSWORD), max_connection_pool_size=MAX_CONNECTION_POOL_SIZE) as _sync_driver:
|
||||
with GraphDatabase.driver(
|
||||
URI,
|
||||
auth=(USERNAME, PASSWORD),
|
||||
max_connection_pool_size=MAX_CONNECTION_POOL_SIZE,
|
||||
) as _sync_driver:
|
||||
try:
|
||||
with _sync_driver.session(database=DATABASE) as session:
|
||||
try:
|
||||
|
Reference in New Issue
Block a user