fix: unwrapping issues with os.Is* functions (#10949)

reduces  3 stat calls, reducing the
overall startup time significantly.
This commit is contained in:
Harshavardhana
2020-11-23 08:36:49 -08:00
committed by GitHub
parent 39f3d5493b
commit df93102235
22 changed files with 158 additions and 166 deletions
+2 -2
View File
@@ -157,7 +157,7 @@ func loadFormatCache(ctx context.Context, drives []string) ([]*formatCacheV2, bo
f, err := os.OpenFile(cacheFormatPath, os.O_RDWR, 0)
if err != nil {
if os.IsNotExist(err) {
if osIsNotExist(err) {
continue
}
logger.LogIf(ctx, err)
@@ -318,7 +318,7 @@ func cacheDrivesUnformatted(drives []string) bool {
count := 0
for _, drive := range drives {
cacheFormatPath := pathJoin(drive, minioMetaBucket, formatConfigFile)
if _, err := os.Stat(cacheFormatPath); os.IsNotExist(err) {
if _, err := os.Stat(cacheFormatPath); osIsNotExist(err) {
count++
}
}