fix new syncer statistics
@@ -206,12 +206,20 @@ func (syncer *Syncer) handleFinderResult(msg *message.FinderResult) error {
}
func (syncer *Syncer) Statistics() *map[string]interface{} {
+ if syncer.ctx == nil {
+ return &map[string]interface{}{
+ "startning": syncer.isstartning,
+ "total": 0,
+ "remain": 0,
+ }
+ } else {
return &map[string]interface{}{
"startning": syncer.isstartning,
"total": syncer.ctx.TotalCnt,
"remain": syncer.ctx.RemainCnt,
}
}
+}
func stopSyncer(hub component.ICompRequester, who string, err error) {
hub.Tell(message.SyncerSvc, &message.SyncStop{FromWho: who, Err: err})
