Fix regression in stagingContext

This commit is contained in:
Tom 2023-05-30 11:25:01 +02:00
parent 3a893bbfb6
commit fcdb3a1d6a
14 changed files with 78 additions and 70 deletions

View file

@ -16,7 +16,7 @@ func (*SQL) BackupName() string {
}
// Backup makes a backup of all SQL databases into the path dest.
func (sql *SQL) Backup(scontext component.StagingContext) error {
func (sql *SQL) Backup(scontext *component.StagingContext) error {
return scontext.AddFile("", func(ctx context.Context, file io.Writer) error {
code := sql.Stack().Exec(ctx, stream.NewIOStream(file, scontext.Progress(), nil, 0), "sql", "mysqldump", "--all-databases")()
if code != 0 {

View file

@ -13,7 +13,7 @@ func (*SQL) SnapshotNeedsRunning() bool { return false }
func (*SQL) SnapshotName() string { return "sql" }
func (sql *SQL) Snapshot(wisski models.Instance, scontext component.StagingContext) error {
func (sql *SQL) Snapshot(wisski models.Instance, scontext *component.StagingContext) error {
return scontext.AddDirectory(".", func(ctx context.Context) error {
return scontext.AddFile(wisski.SqlDatabase+".sql", func(ctx context.Context, file io.Writer) error {
return sql.SnapshotDB(ctx, scontext.Progress(), file, wisski.SqlDatabase)