Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
36feaa4b
Commit
36feaa4b
authored
Jan 24, 2017
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix delete logic
License: MIT Signed-off-by:
Jeromy
<
jeromyj@gmail.com
>
parent
62d23c06
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
7 deletions
+12
-7
filestore/filestore.go
filestore/filestore.go
+12
-7
No files found.
filestore/filestore.go
View file @
36feaa4b
...
...
@@ -89,16 +89,21 @@ func (f *Filestore) DeleteBlock(c *cid.Cid) error {
return
err1
}
if
err2
:=
f
.
fm
.
DeleteBlock
(
c
);
err2
!=
nil
{
// if we successfully removed something from the blockstore, but the
// filestore didnt have it, return success
if
err1
==
nil
&&
err2
!=
blockstore
.
ErrNotFound
{
return
nil
err2
:=
f
.
fm
.
DeleteBlock
(
c
)
// if we successfully removed something from the blockstore, but the
// filestore didnt have it, return success
switch
err2
{
case
nil
:
return
nil
case
blockstore
.
ErrNotFound
:
if
err1
==
blockstore
.
ErrNotFound
{
return
blockstore
.
ErrNotFound
}
return
nil
default
:
return
err2
}
return
nil
}
func
(
f
*
Filestore
)
Get
(
c
*
cid
.
Cid
)
(
blocks
.
Block
,
error
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment