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
44965133
Commit
44965133
authored
Mar 24, 2018
by
Kevin Atkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tweaks.
parent
9cb90a6e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
flatfs.go
flatfs.go
+4
-3
No files found.
flatfs.go
View file @
44965133
...
...
@@ -798,7 +798,7 @@ func (fs *Datastore) updateDiskUsage(path string, add bool) {
func
(
fs
*
Datastore
)
checkpointDiskUsage
()
{
select
{
case
fs
.
checkpointCh
<-
true
:
// msg sen
d
// msg sen
t
default
:
// checkpoint request already pending
}
...
...
@@ -807,19 +807,20 @@ func (fs *Datastore) checkpointDiskUsage() {
func
(
fs
*
Datastore
)
checkpointLoop
()
{
timerActive
:=
true
timer
:=
time
.
NewTimer
(
0
)
defer
timer
.
Stop
()
for
{
select
{
case
_
,
more
:=
<-
fs
.
checkpointCh
:
du
:=
atomic
.
LoadInt64
(
&
fs
.
diskUsage
)
fs
.
dirty
=
true
if
!
more
{
// shutting down
fs
.
writeDiskUsageFile
(
du
)
if
fs
.
dirty
{
log
.
Errorf
(
"could not
right
final value of disk usage to file, future estimates may be inaccurate"
)
log
.
Errorf
(
"could not
store
final value of disk usage to file, future estimates may be inaccurate"
)
}
fs
.
done
<-
true
return
}
fs
.
dirty
=
true
// If the difference between the checkpointed disk usage and
// current one is larger than than `diskUsageCheckpointPercent`
// of the checkpointed: store it.
...
...
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