mirror of
https://github.com/astaxie/beego.git
synced 2024-11-25 20:10:56 +00:00
Allow absolute path for filesystem cache
Gives more flexibility by making it an absolute path. A relative path can easily be created by the user.
This commit is contained in:
parent
e65d87974a
commit
77ed151243
2
cache/file.go
vendored
2
cache/file.go
vendored
@ -92,8 +92,6 @@ func (fc *FileCache) StartAndGC(config string) error {
|
||||
|
||||
// Init will make new dir for file cache if not exist.
|
||||
func (fc *FileCache) Init() {
|
||||
app := filepath.Dir(os.Args[0])
|
||||
fc.CachePath = filepath.Join(app, fc.CachePath)
|
||||
if ok, _ := exists(fc.CachePath); !ok { // todo : error handle
|
||||
_ = os.MkdirAll(fc.CachePath, os.ModePerm) // todo : error handle
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user