AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
fix(backend): give the skills seed a transaction timeout that fits the whole catalog (#14789)
Ubbed211346005ce
diff --git a/autogpt_platform/backend/backend/api/features/store/skill_seed.py b/autogpt_platform/backend/backend/api/features/store/skill_seed.pyindex 8053d90fd0..17270b15f3 100644--- a/autogpt_platform/backend/backend/api/features/store/skill_seed.py+++ b/autogpt_platform/backend/backend/api/features/store/skill_seed.py@@ -29,6 +29,7 @@ import loggingimport osimport tarfileimport tempfile+from datetime import timedeltafrom pathlib import Pathimport httpx@@ -60,6 +61,10 @@ DEFAULT_CATALOG_REF = "main"CATALOG_FILE = "catalog.yml"SKILLS_DIR = "skills"_CONTENT_DIR = Path(__file__).parent / "starter_skills"+# One transaction for the whole catalog, so a failure leaves the marketplace+# as it was. The default 30s covers a handful of listings; a full catalog is+# several queries per listing against a remote database.+SEED_TRANSACTION_TIMEOUT = timedelta(minutes=10)CatalogEntry = StarterSkill@@ -1226,7 +1231,7 @@ async def _seed_loaded() -> list[str]:"""Write a set whose packages have all been loaded and checked."""listing_ids = []- async with database.transaction() as tx:+ async with database.transaction(timeout=SEED_TRANSACTION_TIMEOUT) as tx:for entry, parsed, files in loaded:listing = await _upsert_listing(tx, entry, parsed, files)listing_ids.append(listing.id)