wisski-cloud-distillery/internal/wisski/ingredient/info/snapshots.go
Tom Wiesing 3455f491ca
Add context
This commit adds and passes context around to (almost) every function.
This allows cancelling (almost) every function call globally.
2022-11-29 15:32:31 +01:00

21 lines
405 B
Go

package info
import (
"github.com/FAU-CDI/wisski-distillery/internal/status"
"github.com/FAU-CDI/wisski-distillery/internal/wisski/ingredient"
)
type SnapshotsFetcher struct {
ingredient.Base
Info *Info
}
func (lbr *SnapshotsFetcher) Fetch(flags ingredient.FetcherFlags, info *status.WissKI) (err error) {
if flags.Quick {
return
}
info.Snapshots, _ = lbr.Snapshots(flags.Context)
return
}