mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-27 22:21:07 +03:00
cache: Fix --gc failure on Windows
Fixes "Error: failed to prune cache" on Windows and removes
work around from ec1c97e7e9
.
Follows #10781.
This commit is contained in:
parent
6c798eba60
commit
184a67ac47
2 changed files with 3 additions and 22 deletions
9
cache/filecache/integration_test.go
vendored
9
cache/filecache/integration_test.go
vendored
|
@ -15,7 +15,6 @@ package filecache_test
|
|||
|
||||
import (
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
|
@ -90,12 +89,8 @@ iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAA
|
|||
b.Assert(b.GCCount, qt.Equals, 1)
|
||||
// Build it again to GC the empty a dir.
|
||||
b.Build()
|
||||
if runtime.GOOS != "windows" {
|
||||
// See issue #58860 -- this sometimes fails on Windows,
|
||||
// but the empty directory will be removed on the next run.
|
||||
_, err = b.H.BaseFs.ResourcesCache.Stat(filepath.Join(imagesCacheDir, "a"))
|
||||
b.Assert(err, qt.Not(qt.IsNil))
|
||||
}
|
||||
_, err = b.H.BaseFs.ResourcesCache.Stat(filepath.Join(imagesCacheDir, "a"))
|
||||
b.Assert(err, qt.Not(qt.IsNil))
|
||||
_, err = b.H.BaseFs.ResourcesCache.Stat(imagesCacheDir)
|
||||
b.Assert(err, qt.IsNil)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue