§
    ùñim	  ã                   óÒ   — d dl Z d dlmZ d dlmZ d dlmZ d dlmZ d dl	m
Z
 d dlmZ d dlmZ d d	lmZmZmZ d d
lmZmZ  e j        e¦  «        Zedefd„¦   «         Zdefd„ZdZdS )é    N)Úasynccontextmanager)ÚFastAPI)ÚCORSMiddleware)ÚGZipMiddleware)Úsettings)ÚAuthenticationMiddleware)Úroot_api_router)ÚHTTPExceptionÚhttp_exception_handlerÚGlobalExceptionMiddleware)Úinitialize_system_jobsÚshutdown_system_jobsÚappc                óÌ   K  — t                                d¦  «         t          ¦   «         ƒ d{V —† dW V — t                                d¦  «         t	          ¦   «         ƒ d{V —† dS )z~
    Define FastAPI lifespan events (startup and shutdown).
    Handles database connection pool and other cleanup tasks.
    z&Execute FastAPI startup event handler.Nz'Execute FastAPI shutdown event handler.)ÚlogÚinfor   Úwarningr   ©r   s    ú-/var/www/html/ls-ibe-bot-apis/app/__init__.pyÚlifespanr      s}   è è € õ ‡H‚HÐ5Ñ6Ô6Ð6å
 Ñ
"Ô
"Ð"Ð"Ð"Ð"Ð"Ð"Ð"à	€E€E€E€Eõ
 ‡K‚KÐ9Ñ:Ô:Ð:å
Ñ
 Ô
 Ð Ð Ð Ð Ð Ð Ð Ð Ð ó    Úreturnc            	      ó<  — t                                d¦  «         t          t          j        t          j        ddigt          j        dk    rt          j        ndt          j        dk    rt          j        ndt          j        dk    rt          j	        ndt          ¬¦  «        } |                      t          ¦  «         |                      t          d¬¦  «         t                                d	¦  «         |                      t          ¦  «         t                                d
¦  «         |                      t"          t$          ¦  «         t                                d¦  «         |                      t&          ¦  «         |                      t(          dgdg d¢dg¬¦  «         | S )z)
    Initialize FastAPI application.
    z$Initialize FastAPI application node.Úurlzhttp://127.0.0.1:9000ÚdevelopmentN)ÚtitleÚdebugÚserversÚdocs_urlÚ	redoc_urlÚopenapi_urlr   iè  )Úminimum_sizezAdd application routes.z;Register global exception handler for custom HTTPException.zAdd authentication middleware.Ú*T)ÚGETÚPOSTÚPUTÚDELETEÚOPTIONSÚPATCH)Úallow_originsÚallow_credentialsÚallow_methodsÚallow_headers)r   r   r   r   ÚPROJECT_NAMEÚDEBUGÚENVÚDOCS_URLÚ	REDOC_URLÚOPENAPI_URLr   Úadd_middlewarer   r   Úinclude_routerr	   Úadd_exception_handlerr
   r   r   r   r   s    r   Úget_applicationr7   +   su  € õ ‡I‚IÐ4Ñ5Ô5Ð5å
ÝÔ#ÝŒnØÐ0Ð1Ð2Ý&.¤l°mÒ&CÐ&C•Ô"Ð"ÈÝ(0¬¸Ò(EÐ(E•(Ô$Ð$È4Ý,4¬L¸MÒ,IÐ,I•HÔ(Ð(ÈtÝðñ ô €Cð ×ÒÕ0Ñ1Ô1Ð1Ø×Ò•~°DÐÑ9Ô9Ð9õ ‡I‚IÐ'Ñ(Ô(Ð(Ø×Ò•Ñ'Ô'Ð'õ ‡I‚IÐKÑLÔLÐLØ×ÒmÕ-CÑDÔDÐDõ ‡I‚IÐ.Ñ/Ô/Ð/Ø×ÒÕ/Ñ0Ô0Ð0à×ÒØeØØJÐJÐJØeð	 ñ ô ð ð €Jr   )r7   )ÚloggingÚ
contextlibr   Úfastapir   Úfastapi.middleware.corsr   Úfastapi.middleware.gzipr   Úapp.configsr   Úapp.middleware.authenticationr   Úapp.routersr	   Úapp.exceptionsr
   r   r   Úapp.services.schedulerr   r   Ú	getLoggerÚ__name__r   r   r7   Ú__all__© r   r   ú<module>rF      s<  ðØ €€€Ø *Ð *Ð *Ð *Ð *Ð *à Ð Ð Ð Ð Ð Ø 2Ð 2Ð 2Ð 2Ð 2Ð 2Ø 2Ð 2Ð 2Ð 2Ð 2Ð 2à  Ð  Ð  Ð  Ð  Ð  Ø BÐ BÐ BÐ BÐ BÐ BØ 'Ð 'Ð 'Ð 'Ð 'Ð 'ðð ð ð ð ð ð ð ð ð ð
 PÐ OÐ OÐ OÐ OÐ OÐ OÐ Oð €gÔ˜Ñ!Ô!€ð ð!˜ð !ð !ð !ñ Ôð!ð('˜ð 'ð 'ð 'ð 'ðR €€€r   