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

@ -11,7 +11,7 @@ import (
func (ts *Triplestore) BackupName() string { return "triplestore" }
// Backup makes a backup of all Triplestore repositories databases into the path dest.
func (ts *Triplestore) Backup(scontext component.StagingContext) error {
func (ts *Triplestore) Backup(scontext *component.StagingContext) error {
return scontext.AddDirectory("", func(ctx context.Context) error {
// list all the directories
repos, err := ts.listRepositories(ctx)

View file

@ -14,7 +14,7 @@ func (Triplestore) SnapshotNeedsRunning() bool { return false }
func (Triplestore) SnapshotName() string { return "triplestore" }
func (ts *Triplestore) Snapshot(wisski models.Instance, scontext component.StagingContext) error {
func (ts *Triplestore) Snapshot(wisski models.Instance, scontext *component.StagingContext) error {
return scontext.AddDirectory(".", func(ctx context.Context) error {
return scontext.AddFile(wisski.GraphDBRepository+".nq", func(ctx context.Context, file io.Writer) error {
_, err := ts.SnapshotDB(ctx, file, wisski.GraphDBRepository)