U
    nd&                     @   s   d dl Z d dlZd dlmZmZ d dlmZ d dlmZ d dl	m
Z
 eddgdZejd	d
dee
fedddZejddddd ZdS )    N)	APIRouterDepends)Response)AsyncSession)get_sessionz/healthZHealth)prefixtags/   status_codesessionc              	      sP   zt j| dddI d H  W n& t jtjfk
rD   tdd Y S X tddS )NzSELECT 1   )timeouti  r   r
   )asynciowait_forexecuteTimeoutErrorsocketgaierrorr   r    r   '/var/www/html/BCA_API/app/api/health.pyhealth   s
    r   z/check   c                   C   s   ddiS )z
    Performs a health check on the application.

    Returns:
        dict: A JSON response indicating the health status.
    healthcheckzEverything OK!r   r   r   r   r   r      s    r   )r   r   fastapir   r   starlette.responsesr   Zsqlalchemy.ext.asyncior   Zapp.api.depsr   routergetr   r   r   r   r   r   <module>   s   