Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RHINENG-5394: run vacuum in goroutine so api won't time out #1354

Merged
merged 1 commit into from
Dec 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion turnpike/controllers/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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;")
Expand Down
Loading