forked from mtusi2026/mtusi2026lab5
ЛР 5: RabbitMQ, асинхронные миниатюры и отказы — на 3
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def secret(name):
|
||||
path = os.environ.get(name + "_FILE")
|
||||
if path:
|
||||
return Path(path).read_text().strip()
|
||||
raise RuntimeError(f"{name}_FILE is required")
|
||||
|
||||
|
||||
SESSION_TTL = int(os.getenv("SESSION_TTL_SECONDS", "3600"))
|
||||
if not 1 <= SESSION_TTL <= 604800:
|
||||
raise RuntimeError("SESSION_TTL_SECONDS must be 1..604800")
|
||||
if os.getenv("SESSION_STORE", "postgres") != "postgres":
|
||||
raise RuntimeError("This implementation uses PostgreSQL sessions")
|
||||
Reference in New Issue
Block a user