Commit dfb2bf17 authored by Steven Allen's avatar Steven Allen

make delete idempotent

parent d5e3c1fa
......@@ -636,7 +636,7 @@ func (fs *Datastore) doDelete(key datastore.Key) error {
fs.checkpointDiskUsage()
return nil
case os.IsNotExist(err):
return datastore.ErrNotFound
return nil
default:
return err
}
......
......@@ -344,8 +344,8 @@ func testDeleteNotFound(dirFunc mkShardFunc, t *testing.T) {
defer fs.Close()
err = fs.Delete(datastore.NewKey("quux"))
if g, e := err, datastore.ErrNotFound; g != e {
t.Fatalf("expected ErrNotFound, got: %v\n", g)
if err != nil {
t.Fatalf("expected nil, got: %v\n", err)
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment