From dc4c7e53f737c8f9add08f3cc6fc93f8fea6f997 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=AE=D1=80=D0=B8=D0=B9=20=D0=A7=D0=B5=D1=80=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=BA=D0=BE?= Date: Tue, 15 Sep 2026 14:28:05 +0300 Subject: [PATCH] =?UTF-8?q?BUILD138=20=E2=80=94=20=D0=B8=D1=81=D0=BF=D1=80?= =?UTF-8?q?=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20500=20=D0=B2=20?= =?UTF-8?q?=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BE=D1=87=D0=BD=D0=B8=D0=BA?= =?UTF-8?q?=D0=B5=20=D1=81=D1=82=D0=B0=D0=B4=D0=B8=D0=BE=D0=BD=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.py | 2 +- hockey_data/service.py | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index ffc0bf7..7cdd6af 100644 --- a/app.py +++ b/app.py @@ -29,7 +29,7 @@ from ui_builder import install_ui_builder from khl_site.khl_data_center import APP as khl_site_app BASE_DIR = Path(__file__).resolve().parent -BUILD_VERSION = "2026.09.15.5" +BUILD_VERSION = "2026.09.15.6" # compatibility: BUILD_VERSION = "2026.08.26.1" # compatibility: BUILD_VERSION = "2026.08.25.1" # compatibility: BUILD_VERSION = "2026.08.24.15" diff --git a/hockey_data/service.py b/hockey_data/service.py index 00be047..3064c8e 100644 --- a/hockey_data/service.py +++ b/hockey_data/service.py @@ -867,6 +867,13 @@ class HockeyDataService: if row is None: row = Stadium(external_id=identity, source=str(source or "stat2tv")[:32], active=True) session.add(row) + # BUILD138: HockeyDatabase intentionally uses autoflush=False. + # Flush a newly created stadium immediately so another game in the + # same sync transaction can find the same external_id instead of + # creating a duplicate pending row and failing the UNIQUE constraint + # on commit. Stadium has no FK dependencies, so a targeted flush is + # safe and avoids flushing unrelated match-sync changes. + session.flush([row]) manual = str(row.source or "").casefold() == "manual" for field, value in values.items():