|
@@ -16,10 +16,12 @@ import (
|
|
|
|
|
|
func clarksonsWatch() {
|
|
|
fmt.Println("clarksonsWatch start")
|
|
|
+ utils.FileLog.Info("clarksonsWatch start")
|
|
|
var err error
|
|
|
defer func() {
|
|
|
if err != nil {
|
|
|
fmt.Println("clarksonsWatch Err:" + err.Error())
|
|
|
+ utils.FileLog.Info(fmt.Sprintf("clarksonsWatch, Err: %s", err))
|
|
|
}
|
|
|
}()
|
|
|
var cacheClient *cache.Cache
|
|
@@ -31,9 +33,12 @@ func clarksonsWatch() {
|
|
|
return err
|
|
|
}
|
|
|
if !info.IsDir() {
|
|
|
- fileInfo, err := os.Stat(path)
|
|
|
- if err != nil {
|
|
|
+ fileInfo, e := os.Stat(path)
|
|
|
+ if e != nil {
|
|
|
+ err = e
|
|
|
fmt.Println("os.Stat:", err.Error())
|
|
|
+ utils.FileLog.Info(fmt.Sprintf("os.Stat, Err: %s", err))
|
|
|
+ return err
|
|
|
}
|
|
|
winFileAttr := fileInfo.Sys().(*syscall.Win32FileAttributeData)
|
|
|
modifyTimeStr := utils.SecondToTime(winFileAttr.LastWriteTime.Nanoseconds() / 1e9).Format(utils.FormatDateTime)
|
|
@@ -73,10 +78,12 @@ func Clarksons(path string) (err error) {
|
|
|
xlFile, err = xlsx.OpenFile(path)
|
|
|
if err != nil {
|
|
|
fmt.Println("OpenFile err:", err)
|
|
|
+ utils.FileLog.Info(fmt.Sprintf("OpenFile, Err: %s", err))
|
|
|
return
|
|
|
}
|
|
|
} else {
|
|
|
fmt.Println("Not Exist")
|
|
|
+ utils.FileLog.Info("Not Exist")
|
|
|
return
|
|
|
}
|
|
|
|