mirror of https://github.com/Xhofe/alist
* fix: local proxy download file damage * fix: temp dir removepull/7139/head
parent
4874c9e43b
commit
c9fa3d7cd6
|
@ -102,7 +102,13 @@ func initURL() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func CleanTempDir() {
|
func CleanTempDir() {
|
||||||
if err := os.RemoveAll(conf.Conf.TempDir); err != nil {
|
files, err := os.ReadDir(conf.Conf.TempDir)
|
||||||
log.Errorln("failed delete temp file: ", err)
|
if err != nil {
|
||||||
|
log.Errorln("failed list temp file: ", err)
|
||||||
|
}
|
||||||
|
for _, file := range files {
|
||||||
|
if err := os.RemoveAll(filepath.Join(conf.Conf.TempDir, file.Name())); err != nil {
|
||||||
|
log.Errorln("failed delete temp file: ", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -267,6 +267,12 @@ func Link(ctx context.Context, storage driver.Driver, path string, args model.Li
|
||||||
}
|
}
|
||||||
return link, nil
|
return link, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if storage.Config().OnlyLocal {
|
||||||
|
link, err := fn()
|
||||||
|
return link, file, err
|
||||||
|
}
|
||||||
|
|
||||||
link, err, _ := linkG.Do(key, fn)
|
link, err, _ := linkG.Do(key, fn)
|
||||||
return link, file, err
|
return link, file, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue