Browse Source

skip empty logs

Chris Lu 4 years ago
parent
commit
5179e559f7
1 changed files with 4 additions and 0 deletions
  1. 4 0
      weed/filer/filer_notify.go

+ 4 - 0
weed/filer/filer_notify.go

@@ -83,6 +83,10 @@ func (f *Filer) logMetaEvent(ctx context.Context, fullpath string, eventNotifica
 
 func (f *Filer) logFlushFunc(startTime, stopTime time.Time, buf []byte) {
 
+	if len(buf) == 0 {
+		return
+	}
+
 	startTime, stopTime = startTime.UTC(), stopTime.UTC()
 
 	targetFile := fmt.Sprintf("%s/%04d-%02d-%02d/%02d-%02d.segment", SystemLogDir,