Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.

Wire up context to FlushPath #70

Merged
merged 1 commit into from
Mar 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions mfs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -817,19 +817,19 @@ func TestFlushing(t *testing.T) {
t.Fatal(err)
}

if err := FlushPath(rt, "/a/b/c/TEST"); err != nil {
if err := FlushPath(ctx, rt, "/a/b/c/TEST"); err != nil {
t.Fatal(err)
}

if err := FlushPath(rt, "/a/b/d/TEST"); err != nil {
if err := FlushPath(ctx, rt, "/a/b/d/TEST"); err != nil {
t.Fatal(err)
}

if err := FlushPath(rt, "/a/b/e/TEST"); err != nil {
if err := FlushPath(ctx, rt, "/a/b/e/TEST"); err != nil {
t.Fatal(err)
}

if err := FlushPath(rt, "/FILE"); err != nil {
if err := FlushPath(ctx, rt, "/FILE"); err != nil {
t.Fatal(err)
}

Expand Down
4 changes: 2 additions & 2 deletions ops.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ func DirLookup(d *Directory, pth string) (FSNode, error) {

// TODO: Document this function and link its functionality
// with the republisher.
func FlushPath(rt *Root, pth string) error {
func FlushPath(ctx context.Context, rt *Root, pth string) error {
nd, err := Lookup(rt, pth)
if err != nil {
return err
Expand All @@ -237,6 +237,6 @@ func FlushPath(rt *Root, pth string) error {
return err
}

rt.repub.WaitPub(context.TODO())
rt.repub.WaitPub(ctx)
return nil
}