{backup,snapshot}: Log and display in control

This commit is contained in:
Tom Wiesing 2022-10-03 11:22:45 +02:00
parent 3b112f1b8e
commit 630da9e12f
No known key found for this signature in database
17 changed files with 294 additions and 44 deletions

View file

@ -4,6 +4,7 @@ import (
"fmt"
"time"
"github.com/FAU-CDI/wisski-distillery/internal/models"
"github.com/tkw1536/goprogram/stream"
"golang.org/x/sync/errgroup"
)
@ -20,6 +21,9 @@ type WissKIInfo struct {
Running bool
LastRebuild time.Time
// List of backups made
Snapshots []models.Snapshot
// WissKI content information
Prefixes []string // list of prefixes
Pathbuilders map[string]string // all the pathbuilders
@ -59,6 +63,10 @@ func (wisski *WissKI) Info(quick bool) (info WissKIInfo, err error) {
info.Prefixes, _ = wisski.Prefixes()
return nil
})
group.Go(func() error {
info.Snapshots, _ = wisski.Snapshots()
return nil
})
}
err = group.Wait()