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-ds-flatfs
Commits
c5ecd444
Commit
c5ecd444
authored
Apr 17, 2020
by
Steven Allen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: retry deletes
parent
d174dc3d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
flatfs.go
flatfs.go
+13
-7
No files found.
flatfs.go
View file @
c5ecd444
...
...
@@ -726,16 +726,22 @@ func (fs *Datastore) doDelete(key datastore.Key) error {
fSize
:=
fileSize
(
path
)
switch
err
:=
os
.
Remove
(
path
);
{
case
err
==
nil
:
var
err
error
for
i
:=
0
;
i
<
RetryAttempts
;
i
++
{
err
=
os
.
Remove
(
path
)
if
err
==
nil
{
break
}
else
if
os
.
IsNotExist
(
err
)
{
return
nil
}
}
if
err
==
nil
{
atomic
.
AddInt64
(
&
fs
.
diskUsage
,
-
fSize
)
fs
.
checkpointDiskUsage
()
return
nil
case
os
.
IsNotExist
(
err
)
:
return
nil
default
:
return
err
}
return
err
}
func
(
fs
*
Datastore
)
Query
(
q
query
.
Query
)
(
query
.
Results
,
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