File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -21,14 +21,16 @@ def get_url():
2121 user = os .getenv ("POSTGRES_USER" , "seratonin" )
2222 password = os .getenv ("POSTGRES_PASSWORD" , "seratonin_pass" )
2323
24- # Використовуємо загальні назви DB_HOST та DB_PORT.
25- # Якщо їх немає в .env — беремо дефолти для тунелю.
26- host = os .getenv ("DB_HOST" , "127.0.0.1" )
27- port = os .getenv ("DB_PORT" , os .getenv ("EXTERNAL_POSTGRES_PORT" , "5433" ))
24+ # Використовуємо 'localhost' для Windows-тунелів, це стабільніше за 127.0.0.1
25+ host = os .getenv ("POSTGRES_HOST" , "localhost" )
26+ port = os .getenv ("POSTGRES_PORT" , "5433" )
2827
2928 db = os .getenv ("POSTGRES_DB" , "seratonin_db" )
3029
31- return f"postgresql+asyncpg://{ user } :{ password } @{ host } :{ port } /{ db } "
30+ url = f"postgresql+asyncpg://{ user } :{ password } @{ host } :{ port } /{ db } "
31+ # Вивід для діагностики: ти побачиш куди саме йде коннект
32+ print (f"DEBUG: Generated URL -> postgresql+asyncpg://{ user } :***@{ host } :{ port } /{ db } " )
33+ return url
3234
3335
3436# 2. Встановлюємо URL в конфігурацію
File renamed without changes.
You can’t perform that action at this time.
0 commit comments