Skip to content

Commit

Permalink
random thread picker
Browse files Browse the repository at this point in the history
  • Loading branch information
rskjetlein committed Jan 4, 2021
1 parent 1a509e7 commit 6f6d2cb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions thread/thread.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,8 @@ func (t *Thread) SyncFiles() {
t.mu.Lock()
t.syncFilesWithDisk()
// Quick fix for when several threads writes to same underlying volume
if s := rand.Intn(threadsNum) + 1; s == t.id {
v(1, "Thread %d of %d checking diskspace", t.id, threadsNum)
if s := rand.Intn(threadsNum); s == t.id {
v(1, "Thread %d of %d checking diskspace", t.id, threadsNum-1)
t.cleanUpOnLowDiskSpace()
}
t.mu.Unlock()
Expand Down

0 comments on commit 6f6d2cb

Please sign in to comment.