|
@@ -33,7 +33,7 @@ type ImportStatus struct {
|
|
|
|
|
|
type CGIStatus struct {
|
|
|
mutex sync.RWMutex
|
|
|
- UseTime time.Duration
|
|
|
+ TotalUseTime time.Duration
|
|
|
ImportStatus map[string]*ImportStatus
|
|
|
rc *rc.RoutinesController
|
|
|
lasterror error
|
|
@@ -137,7 +137,8 @@ func (importer *Importer) Import() (totalfilescount, totalrecordscount int64, to
|
|
|
for _, v := range cgistatus.ImportStatus {
|
|
|
totalrecordscount += v.RecordsCount
|
|
|
}
|
|
|
- st := time.Now().Add(-cgistatus.UseTime)
|
|
|
+ totalusetime = cgistatus.TotalUseTime
|
|
|
+ st := time.Now().Add(-totalusetime)
|
|
|
cst := time.Now()
|
|
|
// 遍历文件目录
|
|
|
e = fw.List(func(basedir string, fpath string) bool {
|
|
@@ -168,7 +169,7 @@ func (importer *Importer) Import() (totalfilescount, totalrecordscount int64, to
|
|
|
totalusetime = time.Since(st)
|
|
|
cgistatus.mutex.Lock()
|
|
|
cgistatus.ImportStatus[filename] = &ImportStatus{RecordsCount: records}
|
|
|
- cgistatus.UseTime = totalusetime
|
|
|
+ cgistatus.TotalUseTime = totalusetime
|
|
|
cgistatus.mutex.Unlock()
|
|
|
cgistatus.Save()
|
|
|
},
|