input Getenvs to FlagXYZ
This commit is contained in:
@@ -9,6 +9,10 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
var (
|
||||
FlagBufferedStickyDuration = os.Getenv("WRAP_BUFFERED_STICKY_DURATION")
|
||||
)
|
||||
|
||||
type Buffered struct {
|
||||
ctx context.Context
|
||||
can context.CancelFunc
|
||||
@@ -22,7 +26,7 @@ type Buffered struct {
|
||||
func NewBuffered(ctx context.Context, input Wrap) *Buffered {
|
||||
ctx, can := context.WithCancel(ctx)
|
||||
expirationInterval := time.Millisecond * 125
|
||||
if d, err := time.ParseDuration(os.Getenv("WRAP_BUFFERED_STICKY_DURATION")); err == nil {
|
||||
if d, err := time.ParseDuration(FlagBufferedStickyDuration); err == nil {
|
||||
expirationInterval = d
|
||||
}
|
||||
result := &Buffered{
|
||||
|
||||
Reference in New Issue
Block a user