diff --git a/src/device/input/buffered.go b/src/device/input/buffered.go index c1416f1..6ad5bda 100644 --- a/src/device/input/buffered.go +++ b/src/device/input/buffered.go @@ -2,6 +2,7 @@ package input import ( "context" + "os" "sync" "time" ) @@ -18,14 +19,18 @@ type Buffered struct { func NewBuffered(ctx context.Context, input Input) *Buffered { ctx, can := context.WithCancel(ctx) + expirationInterval := time.Millisecond * 125 + if d, err := time.ParseDuration(os.Getenv("INPUT_BUFFERED_STICKY_DURATION")); err == nil { + expirationInterval = d + } result := &Buffered{ input: input, ctx: ctx, can: can, lock: sync.Mutex{}, keys: map[byte]int64{}, - listenInterval: time.Millisecond * 20, - expirationInterval: time.Millisecond * 100, + listenInterval: time.Millisecond * 10, + expirationInterval: expirationInterval, } go result.listen() return result