[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:
@@ -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
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user