Ë
    t”ŽjS  ã                   óä  — d dl Z d dlZd dlZd dlmZ d dlmZ d dlmZ d dl	m
Z
  ej                  ej                  ¬«       edefd„«       Z ed	e¬
«      Zej                  edgddgdg¬«       ej!                  d«      d„ «       Zd dlmZ ej+                  ed¬«       d dlmZ ej+                  eddg¬«       d dlmZ ej+                  eddg¬«       d dlmZ ej+                  eddg¬«       d dlmZ ej+                  ed¬«       d dlmZ ej+                  ed¬«       d dl mZ! ej+                  e!d¬«       e"dk(  r0 e# e jH                  dd«      «      Z% ejL                  dde%d¬«       yy) é    N)Úasynccontextmanager)ÚFastAPI)ÚCORSMiddleware)Ú
db_manager)ÚlevelÚappc                ó:  K  — 	 t        j                  «       ƒ d {  –—†  t        j                  d«       d ­–— t        j                  «       ƒ d {  –—†  t        j                  d«       y 7 ŒP# t        $ r}t        j
                  d|› �«       |‚d }~ww xY w7 ŒG­w)NzSystem Startup: Database ready.z7System Startup Failed: Could not connect to DB. Error: z,System Shutdown: Database connection closed.)r   ÚconnectÚloggingÚinfoÚ	ExceptionÚcriticalÚclose)r   Úes     ú/var/www/html/photoedit/main.pyÚlifespanr      s‡   è ø€ ðÜ× Ñ Ó"×"Ð"Ü�‰Ð6Ô7ô
 
ô ×
Ñ
Ó
×ÐÜ‡L�LÐ?Õ@ð 	#ùäò Ü×ÑÐRÐSTÐRUÐVÔWØˆûðúð úsC   ‚B„A. ›A,œA. µBÁBÁBÁ,A. Á.	BÁ7BÂBÂBzAI Photo Editor API)Útitler   Ú*T)Úallow_originsÚallow_credentialsÚallow_methodsÚallow_headersz/healthc               ƒ   ó¤   K  — 	 t         j                  j                  j                  d«      ƒ d {  –—†  dddœS 7 Œ	# t        $ r dddœcY S w xY w­w)NÚpingÚonlineÚ	connected)ÚstatusÚdatabaseÚdegradedÚdisconnected)r   ÚclientÚadminÚcommandr   © ó    r   Úhealth_checkr&   +   sW   è ø€ ðBÜ×Ñ×%Ñ%×-Ñ-¨fÓ5×5Ð5Ø"°Ñ<Ð<ð 	6ùäò BØ$°.ÑAÒAðBüs1   ‚A„,< °:±< ¹Aº< ¼AÁ
AÁAÁA)Úrouterz/api)Úprefixz/api/editorzBackground Remover)r(   ÚtagszImage Enhancerz	/api/userÚ	replaceBGÚ__main__ÚPORTi@  zmain:appz0.0.0.0F)ÚhostÚportÚreload)'ÚosÚuvicornr   Ú
contextlibr   Úfastapir   Úfastapi.middleware.corsr   Úapp.config.DBr   ÚbasicConfigÚINFOr   r   Úadd_middlewareÚgetr&   Úapp.modules.user.user_router'   Ú	userRouteÚinclude_routerÚapp.modules.bgRemover.routeÚbg_remover_routerÚapp.modules.enhanceImage.routeÚenhance_routerÚ%app.modules.replaceBG.replaceBG_routeÚreplaceBgRouteÚ+app.modules.subscription.subscription_routeÚsubscription_routerÚ6app.modules.user_subscription.user_subscription_routerÚuser_subscription_routerÚ+app.modules.device_limit.device_limit_routeÚdevice_limit_routerÚ__name__ÚintÚgetenvr.   Úrunr$   r%   r   ú<module>rM      s¶  ðÛ 	Û Û Ý *Ý Ý 2Ý $ð €× Ñ ˜'Ÿ,™,Õ 'ð ðA˜ò Aó ðAñ  Ð)°HÔ=€ð × Ñ ØØ�%ØØ�%Ø�%ð ô ð ‡�ˆÓñBó ðBõ <ð × Ñ ØØð ô õ DØ × Ñ Ð$¨]ÐBVÐAWÐ Ô Xå CØ × Ñ �>¨-Ð?OÐ>PÐ Ô Qõ KØ × Ñ �>¨¸;¸-Ð Ô Hõ Và × Ñ ØØð ô õ
 fØ × Ñ ØØð ô õ VØ × Ñ ØØð ô ð ˆzÒÙˆyˆr�y‰y˜ Ó&Ó'€Dà€G‡K�K�
 °¸eÖDð r%   