* исправила DATABASE_URL
This commit is contained in:
+1
-1
@@ -5,7 +5,7 @@ APP_PORT=8080
|
|||||||
APP_ENV=lab
|
APP_ENV=lab
|
||||||
SESSION_TTL_SECONDS=3600
|
SESSION_TTL_SECONDS=3600
|
||||||
# Choose credentials locally. File paths contain no secret values.
|
# Choose credentials locally. File paths contain no secret values.
|
||||||
DATABASE_URL_FILE=postgresql://user:password@localhost:5432/high_load_messenger
|
DATABASE_URL=postgresql://user:password@localhost:5432/high_load_messenger
|
||||||
# Optional on 3, required use on 4 in lab2; Redis OR Valkey:
|
# Optional on 3, required use on 4 in lab2; Redis OR Valkey:
|
||||||
SESSION_STORE=postgres
|
SESSION_STORE=postgres
|
||||||
CACHE_URL_FILE=/run/secrets/cache_url
|
CACHE_URL_FILE=/run/secrets/cache_url
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ import psycopg
|
|||||||
|
|
||||||
|
|
||||||
def _dsn() -> str:
|
def _dsn() -> str:
|
||||||
dsn = os.environ.get("DATABASE_URL_FILE")
|
dsn = os.environ.get("DATABASE_URL")
|
||||||
if not dsn:
|
if not dsn:
|
||||||
raise RuntimeError("DATABASE_URL_FILE is not set")
|
raise RuntimeError("DATABASE_URL is not set")
|
||||||
return dsn
|
return dsn
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user