From 5b91c6a4824cd71cfa61babc66e07cd4c289b3c3 Mon Sep 17 00:00:00 2001 From: Luc Didry Date: Mon, 14 Apr 2025 16:58:29 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20=E2=80=94=20Fix=20tasks=5Ftmp=20?= =?UTF-8?q?table=20truncating?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + argos/server/queries.py | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 58b813e..51c79db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ - 💄 — Better mobile display - ✨ — Add waiting tasks count on index page and app API - ✨ — Allow to customize the name of the argos agent +- 🩹 — Fix tasks_tmp table truncating ## 0.9.0 diff --git a/argos/server/queries.py b/argos/server/queries.py index 940ed35..4e6da5a 100644 --- a/argos/server/queries.py +++ b/argos/server/queries.py @@ -568,9 +568,8 @@ async def update_from_config(db: Session, config: schemas.Config): db.commit() else: logger.debug("Truncating tasks_tmp table") - db.execute( - sa_text("TRUNCATE TABLE tasks_tmp;").execution_options(autocommit=True) - ) + db.execute(sa_text("TRUNCATE TABLE tasks_tmp RESTART IDENTITY;")) + db.commit() return { "added": added_tasks,