reduce unnecessary sqlite indexes
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
10
main.go
10
main.go
@@ -39,6 +39,7 @@ const fallbackEncryptionKey = "5L1l3B5KvwOCzUHMAlCgsgUTRAYMfSpa"
|
||||
func main() {
|
||||
settingsPath := flag.String("settings", "/etc/dtms/vctp.yml", "Path to settings YAML")
|
||||
runInventory := flag.Bool("run-inventory", false, "Run a single inventory snapshot across all configured vCenters and exit")
|
||||
dbCleanup := flag.Bool("db-cleanup", false, "Run a one-time cleanup to drop low-value hourly snapshot indexes and exit")
|
||||
flag.Parse()
|
||||
|
||||
bootstrapLogger := log.New(log.LevelInfo, log.OutputText)
|
||||
@@ -87,6 +88,15 @@ func main() {
|
||||
logger.Error("failed to migrate database", "error", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
if *dbCleanup {
|
||||
dropped, err := db.CleanupHourlySnapshotIndexes(ctx, database.DB())
|
||||
if err != nil {
|
||||
logger.Error("failed to cleanup hourly snapshot indexes", "error", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
logger.Info("completed hourly snapshot index cleanup", "indexes_dropped", dropped)
|
||||
return
|
||||
}
|
||||
|
||||
// Determine bind IP
|
||||
bindIP := strings.TrimSpace(s.Values.Settings.BindIP)
|
||||
|
||||
Reference in New Issue
Block a user