Implement durable image processing pipeline with outbox and recovery

This commit is contained in:
Polusikkkk
2026-11-17 18:48:50 +03:00
parent 276dbdad8a
commit be223efc8b
84 changed files with 8982 additions and 18 deletions
+24
View File
@@ -0,0 +1,24 @@
from __future__ import annotations
import os
import psycopg
from psycopg.rows import dict_row
def connect_db():
return psycopg.connect(
host=os.getenv("PGHOST", "postgres"),
port=int(os.getenv("PGPORT", "5432")),
dbname=os.getenv("PGDATABASE", "messenger"),
user=os.getenv("PGUSER", "messenger"),
password=os.environ["PGPASSWORD"],
connect_timeout=3,
autocommit=True,
row_factory=dict_row,
options=(
"-c statement_timeout=3000 "
"-c lock_timeout=2000 "
"-c idle_in_transaction_session_timeout=60000"
),
)