19 lines
632 B
Go
19 lines
632 B
Go
package configserver
|
|
|
|
import "context"
|
|
|
|
// api_maintain.go — обслуживание: очистка старых версий.
|
|
|
|
// CleanupOldVersions удаляет версии compose/env и логи миграций старше days дней
|
|
// (текущие версии не трогаются).
|
|
func (a *API) CleanupOldVersions(ctx context.Context, days int) (*CleanupAck, error) {
|
|
ctx, cancel := a.withTimeout(ctx)
|
|
defer cancel()
|
|
body := map[string]int{"days": days}
|
|
out := &CleanupAck{}
|
|
if err := a.Sess.postJSON(ctx, "/api/cleanup_old_versions", body, out); err != nil {
|
|
return nil, err
|
|
}
|
|
return out, nil
|
|
}
|