diff options
author | Mike Wallace <mikewallace1979@googlemail.com> | 2014-08-06 21:22:56 +0100 |
---|---|---|
committer | Jay Doane <jaydoane@apache.org> | 2021-04-19 00:34:24 -0700 |
commit | d937147f1fe7516236b5eeb914360aa9815b3dce (patch) | |
tree | 5d6af3f240f17ae631b297987bba17ea7039a83d | |
parent | abc9c53a288e6ed2f43dcef813521961e71b0914 (diff) | |
download | couchdb-d937147f1fe7516236b5eeb914360aa9815b3dce.tar.gz |
Optimize noatime check
This commit removes the need to sleep for one second when testing
for noatime by forcing the atime to a specific date in the past,
rather than using the current time and sleeping for 1001 ms.
BugzID: 33261
-rw-r--r-- | src/weatherreport/src/weatherreport_check_disk.erl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/weatherreport/src/weatherreport_check_disk.erl b/src/weatherreport/src/weatherreport_check_disk.erl index f2405bbf6..8d14d2a76 100644 --- a/src/weatherreport/src/weatherreport_check_disk.erl +++ b/src/weatherreport/src/weatherreport_check_disk.erl @@ -157,8 +157,8 @@ check_is_file_readable(Directory) -> %% Check if the directory is mounted with 'noatime' check_atime(Directory) -> File = filename:join([Directory, ?TEST_FILE]), + weatherreport_util:run_command("touch -at 201401010000.00 " ++ File), {ok, FileInfo1} = file:read_file_info(File), - timer:sleep(1001), {ok, S} = file:open(File, [read]), io:get_line(S, ''), file:close(S), |