[bugfix] temporarily removes the sqlite vacuum CLI action, as it seems to fail with i/o issues (#4859)

Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4859
This commit is contained in:
kim
2026-06-15 09:36:41 +02:00
committed by tobi
parent 40ed94590f
commit c35d2b7264
2 changed files with 22 additions and 21 deletions
+11 -10
View File
@@ -30,7 +30,8 @@ import (
// check function conformance.
var _ action.GTSAction = SQLiteAnalyze
var _ action.GTSAction = SQLiteVacuum
// var _ action.GTSAction = SQLiteVacuum
func SQLiteAnalyze(ctx context.Context) error {
return do(ctx, func(db *bun.DB) error {
@@ -42,12 +43,12 @@ func SQLiteAnalyze(ctx context.Context) error {
})
}
func SQLiteVacuum(ctx context.Context) error {
return do(ctx, func(db *bun.DB) error {
if db.Dialect().Name() != dialect.SQLite {
return errors.New("cannot perform sqlite vacuum on non-sqlite db")
}
_, err := db.ExecContext(ctx, "vacuum;")
return err
})
}
// func SQLiteVacuum(ctx context.Context) error {
// return do(ctx, func(db *bun.DB) error {
// if db.Dialect().Name() != dialect.SQLite {
// return errors.New("cannot perform sqlite vacuum on non-sqlite db")
// }
// _, err := db.ExecContext(ctx, "vacuum;")
// return err
// })
// }
+11 -11
View File
@@ -31,17 +31,17 @@ func sqliteCommands() *cobra.Command {
Short: "sqlite-specific tasks",
}
sqliteCmd.AddCommand(&cobra.Command{
Use: "vacuum",
Short: "performs an sqlite \"vacuum\" operation; " +
"please note this requires AT LEAST db size free disk-space",
PreRunE: func(cmd *cobra.Command, args []string) error {
return preRun(preRunArgs{cmd: cmd})
},
RunE: func(cmd *cobra.Command, args []string) error {
return run(cmd.Context(), database.SQLiteVacuum)
},
})
// sqliteCmd.AddCommand(&cobra.Command{
// Use: "vacuum",
// Short: "performs an sqlite \"vacuum\" operation; " +
// "please note this requires AT LEAST db size free disk-space",
// PreRunE: func(cmd *cobra.Command, args []string) error {
// return preRun(preRunArgs{cmd: cmd})
// },
// RunE: func(cmd *cobra.Command, args []string) error {
// return run(cmd.Context(), database.SQLiteVacuum)
// },
// })
sqliteCmd.AddCommand(&cobra.Command{
Use: "analyze",