File tree Expand file tree Collapse file tree 4 files changed +25
-5
lines changed
cmd/chirpstack-gateway-bridge/cmd Expand file tree Collapse file tree 4 files changed +25
-5
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,18 @@ type="{{ .Backend.Type }}"
9494 # disconnected and it will unsubscribe from the gateway MQTT topic and cleanup the UDP docket.
9595 connection_timeout_duration={{ .Backend.SemtechUDP.CleanupDuration }}
9696
97+ # Cache expiration
98+ #
99+ # ChirpStack Gateway Bridge temporarily store downlinks. If a gateway does not send any
100+ # UDP data within the configured timeout the downlink is discarded.
101+ cache_default_expiration="{{ .Backend.SemtechUDP.CacheDefaultExpiration }}"
102+
103+ # Cache cleanup interval
104+ #
105+ # ChirpStack Gateway Bridge temporarily store downlinks in a cache. The cache is cleaned in
106+ # the configured interval.
107+ cache_cleanup_interval="{{ .Backend.SemtechUDP.CacheCleanupInterval }}"
108+
97109
98110 # Basic Station backend.
99111 [backend.basic_station]
Original file line number Diff line number Diff line change @@ -41,6 +41,9 @@ func init() {
4141 viper .SetDefault ("backend.semtech_udp.udp_bind" , "0.0.0.0:1700" )
4242 viper .SetDefault ("backend.semtech_udp.cleanup_duration" , time .Minute )
4343
44+ viper .SetDefault ("backend.semtech_udp.cache_default_expiration" , 15 * time .Second )
45+ viper .SetDefault ("backend.semtech_udp.cache_cleanup_interval" , 15 * time .Second )
46+
4447 viper .SetDefault ("backend.concentratord.crc_check" , true )
4548 viper .SetDefault ("backend.concentratord.event_url" , "ipc:///tmp/concentratord_event" )
4649 viper .SetDefault ("backend.concentratord.command_url" , "ipc:///tmp/concentratord_command" )
Original file line number Diff line number Diff line change @@ -72,7 +72,10 @@ func NewBackend(conf config.Config) (*Backend, error) {
7272 },
7373 fakeRxTime : conf .Backend .SemtechUDP .FakeRxTime ,
7474 skipCRCCheck : conf .Backend .SemtechUDP .SkipCRCCheck ,
75- cache : cache .New (15 * time .Second , 15 * time .Second ),
75+ cache : cache .New (
76+ conf .Backend .SemtechUDP .CacheDefaultExpiration ,
77+ conf .Backend .SemtechUDP .CacheCleanupInterval ,
78+ ),
7679 }
7780
7881 go func () {
Original file line number Diff line number Diff line change @@ -21,10 +21,12 @@ type Config struct {
2121 Type string `mapstructure:"type"`
2222
2323 SemtechUDP struct {
24- UDPBind string `mapstructure:"udp_bind"`
25- SkipCRCCheck bool `mapstructure:"skip_crc_check"`
26- FakeRxTime bool `mapstructure:"fake_rx_time"`
27- CleanupDuration int `mapstructure:"connection_timeout_duration"`
24+ UDPBind string `mapstructure:"udp_bind"`
25+ SkipCRCCheck bool `mapstructure:"skip_crc_check"`
26+ FakeRxTime bool `mapstructure:"fake_rx_time"`
27+ CleanupDuration int `mapstructure:"connection_timeout_duration"`
28+ CacheDefaultExpiration time.Duration `mapstructure:"cache_default_expiration"`
29+ CacheCleanupInterval time.Duration `mapstructure:"cache_cleanup_interval"`
2830 } `mapstructure:"semtech_udp"`
2931
3032 BasicStation struct {
You can’t perform that action at this time.
0 commit comments