From 5132d8f097a7eef2cb3d43c1c4cd297bc8254df5 Mon Sep 17 00:00:00 2001 From: Patrick Connolly Date: Tue, 6 Nov 2018 04:53:51 +0800 Subject: Stop setting API ring buffer capacity if not specified. (#552) --- bridge/api/api.go | 4 +++- matterbridge.toml.sample | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/bridge/api/api.go b/bridge/api/api.go index 0ccd85b6..1efe7558 100644 --- a/bridge/api/api.go +++ b/bridge/api/api.go @@ -33,7 +33,9 @@ func New(cfg *bridge.Config) bridge.Bridger { e.HideBanner = true e.HidePort = true b.Messages = ring.Ring{} - b.Messages.SetCapacity(b.GetInt("Buffer")) + if b.GetInt("Buffer") != 0 { + b.Messages.SetCapacity(b.GetInt("Buffer")) + } if b.GetString("Token") != "" { e.Use(middleware.KeyAuth(func(key string, c echo.Context) (bool, error) { return key == b.GetString("Token"), nil diff --git a/matterbridge.toml.sample b/matterbridge.toml.sample index 0ec55962..76875aca 100644 --- a/matterbridge.toml.sample +++ b/matterbridge.toml.sample @@ -1214,6 +1214,7 @@ ShowTopicChange=false BindAddress="127.0.0.1:4242" #Amount of messages to keep in memory +#OPTIONAL (library default 10) Buffer=1000 #Bearer token used for authentication -- cgit v1.2.3