Skip to content

Module API.main

Variables

ENABLE_CUSTOM_EXPORTS
ENABLE_HDX_EXPORTS
ENABLE_METRICS_APIS
ENABLE_POLYGON_STATISTICS_ENDPOINTS
EXPORT_PATH
LOG_LEVEL
SENTRY_DSN
SENTRY_RATE
USE_CONNECTION_POOLING
USE_S3_TO_UPLOAD
app
origins

Functions

add_process_time_header

def add_process_time_header(
    request,
    call_next
)
Times request and knows response time and pass it to header in every request

Args: request (type): description call_next (type): description

Returns: header with process time

on_shutdown

def on_shutdown(

)
Closing all the threads connection from pooling before shuting down the api

on_startup

def on_startup(

)
Fires up 3 idle conenction with threaded connection pooling before starting the API

Raises: e: if connection is rejected to database