Fix atime support check for disk cache (#7891)

- add a sleep between Stat operations to
accurately detect atime
This commit is contained in:
poornas
2019-07-10 15:41:11 -07:00
committed by kannappanr
parent 94f67ad224
commit 20a15567b8
2 changed files with 9 additions and 13 deletions

View File

@@ -945,7 +945,10 @@ func checkAtimeSupport(dir string) (err error) {
if err != nil {
return
}
if _, err = io.Copy(ioutil.Discard, file); err != io.EOF {
// add a sleep to ensure atime change is detected
time.Sleep(10 * time.Millisecond)
if _, err = io.Copy(ioutil.Discard, file); err != nil {
return
}