mirror of
				https://github.com/TeaOSLab/EdgeNode.git
				synced 2025-11-04 07:40:56 +08:00 
			
		
		
		
	优化错误日志处理
This commit is contained in:
		@@ -187,7 +187,7 @@ func (this *IPListManager) fetch() (hasNext bool, err error) {
 | 
			
		||||
	})
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		if rpc.IsConnError(err) {
 | 
			
		||||
			remotelogs.Warn("IP_LIST_MANAGER", "rpc connection error: "+err.Error())
 | 
			
		||||
			remotelogs.Debug("IP_LIST_MANAGER", "rpc connection error: "+err.Error())
 | 
			
		||||
			return false, nil
 | 
			
		||||
		}
 | 
			
		||||
		return false, err
 | 
			
		||||
 
 | 
			
		||||
@@ -50,7 +50,11 @@ func (this *APIStream) Start() {
 | 
			
		||||
		}
 | 
			
		||||
		err := this.loop()
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			remotelogs.Warn("API_STREAM", err.Error())
 | 
			
		||||
			if rpc.IsConnError(err) {
 | 
			
		||||
				remotelogs.Debug("API_STREAM", err.Error())
 | 
			
		||||
			} else {
 | 
			
		||||
				remotelogs.Warn("API_STREAM", err.Error())
 | 
			
		||||
			}
 | 
			
		||||
			time.Sleep(10 * time.Second)
 | 
			
		||||
			continue
 | 
			
		||||
		}
 | 
			
		||||
@@ -76,7 +80,7 @@ func (this *APIStream) loop() error {
 | 
			
		||||
		if this.isQuiting {
 | 
			
		||||
			return nil
 | 
			
		||||
		}
 | 
			
		||||
		return errors.Wrap(err)
 | 
			
		||||
		return err
 | 
			
		||||
	}
 | 
			
		||||
	this.stream = nodeStream
 | 
			
		||||
 | 
			
		||||
@@ -92,7 +96,7 @@ func (this *APIStream) loop() error {
 | 
			
		||||
				remotelogs.Println("API_STREAM", "quit")
 | 
			
		||||
				return nil
 | 
			
		||||
			}
 | 
			
		||||
			return errors.Wrap(err)
 | 
			
		||||
			return err
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		// 处理消息
 | 
			
		||||
 
 | 
			
		||||
@@ -53,7 +53,11 @@ func (this *OCSPUpdateTask) Start() {
 | 
			
		||||
	for range this.ticker.C {
 | 
			
		||||
		err := this.Loop()
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			remotelogs.Warn("OCSPUpdateTask", "update ocsp failed: "+err.Error())
 | 
			
		||||
			if rpc.IsConnError(err) {
 | 
			
		||||
				remotelogs.Debug("OCSPUpdateTask", "update ocsp failed: "+err.Error())
 | 
			
		||||
			} else {
 | 
			
		||||
				remotelogs.Warn("OCSPUpdateTask", "update ocsp failed: "+err.Error())
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user