We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 4f37be8 + 74ce364 commit 3acc34aCopy full SHA for 3acc34a
bufferflow_timed.go
@@ -2,8 +2,9 @@ package main
2
3
import (
4
"encoding/json"
5
- log "github.com/Sirupsen/logrus"
6
"time"
+
7
+ log "github.com/Sirupsen/logrus"
8
)
9
10
type BufferflowTimed struct {
@@ -31,10 +32,12 @@ func (b *BufferflowTimed) Init() {
31
32
go func() {
33
b.ticker = time.NewTicker(16 * time.Millisecond)
34
for _ = range b.ticker.C {
- m := SpPortMessage{bufferedOutput}
35
- buf, _ := json.Marshal(m)
36
- b.Output <- []byte(buf)
37
- bufferedOutput = ""
+ if bufferedOutput != "" {
+ m := SpPortMessage{bufferedOutput}
+ buf, _ := json.Marshal(m)
38
+ b.Output <- []byte(buf)
39
+ bufferedOutput = ""
40
+ }
41
}
42
}()
43
0 commit comments