From b4e2877fc6e0c82fa3a88eeff7f7fa32602fa7e0 Mon Sep 17 00:00:00 2001 From: Patrik Segedy Date: Mon, 11 Dec 2023 11:58:55 +0100 Subject: [PATCH] RHINENG-5394: run vacuum in goroutine so api won't time out --- turnpike/controllers/admin.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/turnpike/controllers/admin.go b/turnpike/controllers/admin.go index a1418102a..a41aa4fb9 100644 --- a/turnpike/controllers/admin.go +++ b/turnpike/controllers/admin.go @@ -302,7 +302,6 @@ func MigrateSystemPackage(c *gin.Context) { var cnt int64 db := database.Db - execQuery(db, "VACUUM ANALYZE system_package;") db.Table("system_package2").Count(&cnt) if cnt > 0 { utils.LogInfo("System_package2 table is not empty") @@ -312,6 +311,7 @@ func MigrateSystemPackage(c *gin.Context) { // nolint:lll go func() { + execQuery(db, "VACUUM ANALYZE system_package;") execQuery(db, "ALTER TABLE system_package2 DROP CONSTRAINT system_package2_applicable_id_fkey;") execQuery(db, "ALTER TABLE system_package2 DROP CONSTRAINT system_package2_installable_id_fkey;") execQuery(db, "ALTER TABLE system_package2 DROP CONSTRAINT system_package2_name_id_fkey;")