update conn string
This commit is contained in:
parent
135bea642c
commit
d588c7cc2f
9 changed files with 13 additions and 13 deletions
|
|
@ -17,7 +17,7 @@ def _():
|
|||
|
||||
@app.cell
|
||||
def _():
|
||||
from pif_compiler.services.common_log import get_logger
|
||||
from pif_compiler.functions.common_log import get_logger
|
||||
|
||||
log = get_logger()
|
||||
return (log,)
|
||||
|
|
@ -128,7 +128,7 @@ def _(response_dossier_json, substance):
|
|||
|
||||
@app.cell
|
||||
def _():
|
||||
from pif_compiler.services.db_utils import get_client
|
||||
from pif_compiler.functions.db_utils import get_client
|
||||
|
||||
client = get_client()
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import re as standardre
|
|||
import json
|
||||
from bs4 import BeautifulSoup
|
||||
from datetime import datetime
|
||||
from pif_compiler.services.common_log import get_logger
|
||||
from pif_compiler.functions.common_log import get_logger
|
||||
|
||||
logger = get_logger()
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ from pydantic import BaseModel, Field
|
|||
from typing import Optional, Dict, Any
|
||||
|
||||
from pif_compiler.services.srv_echa import orchestrator
|
||||
from pif_compiler.services.common_log import get_logger
|
||||
from pif_compiler.functions.common_log import get_logger
|
||||
|
||||
logger = get_logger()
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ from urllib.parse import quote_plus
|
|||
from dotenv import load_dotenv
|
||||
from pymongo import MongoClient
|
||||
|
||||
from pif_compiler.services.common_log import get_logger
|
||||
from pif_compiler.functions.common_log import get_logger
|
||||
|
||||
# config log and env
|
||||
logger = get_logger()
|
||||
|
|
@ -16,8 +16,8 @@ def get_client():
|
|||
MONGO_HOST = os.getenv("MONGO_HOST")
|
||||
MONGO_PORT = os.getenv("MONGO_PORT")
|
||||
|
||||
MONGO_PORT = MONGO_PORT
|
||||
ADMIN_PASSWORD = quote_plus(ADMIN_PASSWORD)
|
||||
ADMIN_USER = quote_plus(ADMIN_USER)
|
||||
|
||||
client = MongoClient(
|
||||
f"mongodb://{ADMIN_USER}:{ADMIN_PASSWORD}@{MONGO_HOST}:{MONGO_PORT}/?authSource=admin",
|
||||
|
|
@ -42,7 +42,7 @@ def db_connect(db_name : str = 'toxinfo', collection_name : str = 'substance_ind
|
|||
|
||||
if __name__ == "__main__":
|
||||
coll = db_connect()
|
||||
if coll:
|
||||
if coll is not None:
|
||||
logger.info("Database connection successful.")
|
||||
else:
|
||||
logger.error("Database connection failed.")
|
||||
|
|
@ -5,7 +5,7 @@ from fastapi.exceptions import RequestValidationError
|
|||
from contextlib import asynccontextmanager
|
||||
import time
|
||||
|
||||
from pif_compiler.services.common_log import get_logger
|
||||
from pif_compiler.functions.common_log import get_logger
|
||||
|
||||
# Import dei tuoi router
|
||||
from pif_compiler.api.routes import api_echa
|
||||
|
|
|
|||
|
|
@ -30,11 +30,11 @@ from pif_compiler.services.pubchem_service import (
|
|||
)
|
||||
|
||||
# Logging
|
||||
from pif_compiler.services.common_log import (
|
||||
from pif_compiler.functions.common_log import (
|
||||
get_logger,
|
||||
)
|
||||
|
||||
from pif_compiler.services.db_utils import get_client
|
||||
from pif_compiler.functions.db_utils import get_client
|
||||
|
||||
|
||||
__all__ = [
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import json as js
|
|||
import re
|
||||
import requests as req
|
||||
from typing import Union
|
||||
from pif_compiler.services.common_log import get_logger
|
||||
from pif_compiler.functions.common_log import get_logger
|
||||
|
||||
logger = get_logger()
|
||||
|
||||
|
|
|
|||
|
|
@ -7,8 +7,8 @@ from bs4 import BeautifulSoup
|
|||
from dotenv import load_dotenv
|
||||
from playwright.sync_api import sync_playwright
|
||||
|
||||
from pif_compiler.services.common_log import get_logger
|
||||
from pif_compiler.services.db_utils import db_connect
|
||||
from pif_compiler.functions.common_log import get_logger
|
||||
from pif_compiler.functions.db_utils import db_connect
|
||||
|
||||
log = get_logger()
|
||||
load_dotenv()
|
||||
|
|
|
|||
Loading…
Reference in a new issue