mirror of
https://github.com/simon-ding/polaris.git
synced 2026-06-01 07:27:40 +08:00
chore: add log
This commit is contained in:
@@ -96,7 +96,7 @@ func (b *Base) Upload(destDir string, tryLink, detectMime, changeMediaHash bool,
|
|||||||
}
|
}
|
||||||
log.Debugf("local storage target base dir is: %v", targetBase)
|
log.Debugf("local storage target base dir is: %v", targetBase)
|
||||||
|
|
||||||
err = walkFn(func(path string, info fs.FileInfo) error {
|
err = walkFn(func(path string, info fs.FileInfo) (err error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@@ -113,6 +113,13 @@ func (b *Base) Upload(destDir string, tryLink, detectMime, changeMediaHash bool,
|
|||||||
log.Debugf("file is not needed, skip: %s", info.Name())
|
log.Debugf("file is not needed, skip: %s", info.Name())
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
defer func () {
|
||||||
|
if err == nil {
|
||||||
|
log.Infof("copy file success, filename %s, destination %s", rel, destName)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
if tryLink {
|
if tryLink {
|
||||||
if err := os.Link(path, destName); err == nil {
|
if err := os.Link(path, destName); err == nil {
|
||||||
return nil //link success
|
return nil //link success
|
||||||
|
|||||||
Reference in New Issue
Block a user