This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Attaching to dev_api_1 | |
[36mapi_1 |[0m INFO: Started server process [1] | |
[36mapi_1 |[0m 2021-11-20 11:15:13,686 Started server process [1] | |
[36mapi_1 |[0m INFO: Waiting for application startup. | |
[36mapi_1 |[0m 2021-11-20 11:15:13,687 Waiting for application startup. | |
[36mapi_1 |[0m INFO: Application startup complete. | |
[36mapi_1 |[0m 2021-11-20 11:15:13,687 Application startup complete. | |
[36mapi_1 |[0m INFO: Uvicorn running on http://0.0.0.0:8080 (Press CTRL+C to quit) | |
[36mapi_1 |[0m 2021-11-20 11:15:13,693 Uvicorn running on http://0.0.0.0:8080 (Press CTRL+C to quit) | |
[36mapi_1 |[0m [36.4609375, 36.4609375, 36.4609375, 36.4609375, 36.4609375] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import gc | |
import logging | |
import tracemalloc | |
from collections import OrderedDict | |
from fastapi import FastAPI | |
from memory_profiler import memory_usage | |
FORMAT = '%(asctime)-15s %(message)s' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const get_jobs_created_ids = (context, event) => new Promise((resolve, reject) => { | |
// return reject('No query specified'); | |
const data = event.value; | |
const formData = new FormData(); | |
Array.from(data.files).forEach((file) => { | |
formData.append('files', file); | |
}); | |
axios.post(`${baseUrl}/uploads/`, formData, { | |
withCredentials: true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import logging | |
import time | |
from functools import lru_cache | |
import uvicorn | |
from aiocache import cached | |
from fastapi import FastAPI, APIRouter, Depends | |
logger = logging.getLogger(__name__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import logging | |
import time | |
from functools import lru_cache | |
import uvicorn | |
from async_lru import alru_cache | |
from fastapi import FastAPI, APIRouter, Depends | |
logger = logging.getLogger(__name__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- name: get_notes | |
-- record_class: NoteProduct | |
SELECT note.product_id, note.name , product_name, manufacturer | |
FROM nested.product | |
join nested.note on product.note = note.product_id; | |
-- name: get_notes_json | |
select coalesce(array_to_json(array_agg(row_to_json(response))),'[]')::character varying AS BODYFROM from ( | |
SELECT (note.product_id , note.name) as note , product_name, manufacturer | |
FROM nested.product |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class NgrokTunnel: | |
def __init__(self, port: str): | |
assert find_executable( | |
"ngrok" | |
), "ngrok command must be installed, see https://ngrok.com/" | |
self.port = port | |
def start(self, ngrok_die_check_delay: float = 0.5) -> Optional[str]: | |
logger.debug(f"Starting ngrok tunnel for port {self.port}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
from contextvars import ContextVar | |
from typing import Dict, Tuple | |
import fastapi | |
import yappi | |
from starlette.middleware.base import BaseHTTPMiddleware | |
from starlette.requests import Request | |
from starlette.responses import Response | |
from starlette.types import ASGIApp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
import asyncio | |
import uvicorn | |
from aio_pika import connect_robust, ExchangeType, IncomingMessage | |
from celery import Celery | |
from fastapi import FastAPI | |
from starlette.applications import Starlette | |
from starlette.requests import Request | |
from starlette.responses import JSONResponse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import functools | |
import ssl | |
from pathlib import Path | |
import pytest | |
from databases import Database | |
def async_adapter(wrapped_func): | |
""" |
NewerOlder