Compare commits
8 Commits
wip/refrac
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 87599a67d5 | |||
| e266f814ca | |||
| c1f06eb9c7 | |||
| d6b65594b8 | |||
|
|
94fd72344d | ||
|
|
43aff3568f | ||
|
|
6f67cfec9a | ||
|
|
f2c09d09e6 |
10
db_calls.py
10
db_calls.py
@ -61,7 +61,7 @@ async def db_get(
|
||||
object_id: int = None,
|
||||
params: list = None,
|
||||
none_okay: bool = True,
|
||||
timeout: int = 3,
|
||||
timeout: int = 30,
|
||||
) -> Optional[dict]:
|
||||
req_url = get_req_url(endpoint, api_ver=api_ver, object_id=object_id, params=params)
|
||||
log_string = f"get:\n{endpoint} id: {object_id} params: {params}"
|
||||
@ -86,7 +86,7 @@ async def db_get(
|
||||
raise ValueError(f"DB: {e}")
|
||||
|
||||
|
||||
async def url_get(url: str, timeout: int = 3) -> dict:
|
||||
async def url_get(url: str, timeout: int = 30) -> dict:
|
||||
log_string = f"get:\n{url}"
|
||||
logger.info(log_string) if master_debug else logger.debug(log_string)
|
||||
|
||||
@ -105,7 +105,7 @@ async def url_get(url: str, timeout: int = 3) -> dict:
|
||||
|
||||
|
||||
async def db_patch(
|
||||
endpoint: str, object_id: int, params: list, api_ver: int = 2, timeout: int = 3
|
||||
endpoint: str, object_id: int, params: list, api_ver: int = 2, timeout: int = 30
|
||||
) -> dict:
|
||||
req_url = get_req_url(endpoint, api_ver=api_ver, object_id=object_id, params=params)
|
||||
log_string = f"patch:\n{endpoint} {params}"
|
||||
@ -126,7 +126,7 @@ async def db_patch(
|
||||
|
||||
|
||||
async def db_post(
|
||||
endpoint: str, api_ver: int = 2, payload: dict = None, timeout: int = 3
|
||||
endpoint: str, api_ver: int = 2, payload: dict = None, timeout: int = 30
|
||||
) -> dict:
|
||||
req_url = get_req_url(endpoint, api_ver=api_ver)
|
||||
log_string = f"post:\n{endpoint} payload: {payload}\ntype: {type(payload)}"
|
||||
@ -147,7 +147,7 @@ async def db_post(
|
||||
|
||||
|
||||
async def db_put(
|
||||
endpoint: str, api_ver: int = 2, payload: dict = None, timeout: int = 3
|
||||
endpoint: str, api_ver: int = 2, payload: dict = None, timeout: int = 30
|
||||
) -> dict:
|
||||
req_url = get_req_url(endpoint, api_ver=api_ver)
|
||||
log_string = f"put:\n{endpoint} payload: {payload}\ntype: {type(payload)}"
|
||||
|
||||
@ -418,7 +418,7 @@ pd-cards upload s3 --cardset <name> [OPTIONS]
|
||||
cd /mnt/NV2/Development/paper-dynasty/database
|
||||
DATABASE_TYPE=postgresql POSTGRES_HOST=10.10.0.42 POSTGRES_DB=paperdynasty_dev \
|
||||
POSTGRES_USER=sba_admin POSTGRES_PASSWORD=<pw> POSTGRES_PORT=5432 \
|
||||
API_TOKEN=Tp3aO3jhYve5NJF1IqOmJTmk \
|
||||
API_TOKEN=your-api-token-here \
|
||||
uvicorn app.main:app --host 0.0.0.0 --port 8000
|
||||
|
||||
# Terminal 2: Upload with local rendering
|
||||
|
||||
@ -96,7 +96,7 @@ def build_c_throw(all_positions, pos_code):
|
||||
|
||||
async def fetch_data(data):
|
||||
start_time = log_time("start", print_to_console=False)
|
||||
this_query = await db_get(endpoint=data[0], params=data[1])
|
||||
this_query = await db_get(endpoint=data[0], params=data[1], timeout=120)
|
||||
log_time("end", print_to_console=False, start_time=start_time)
|
||||
return this_query
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user