Skip to content

Commit

Permalink
fix nil error when rate limiter is not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
agbpatro committed Apr 4, 2024
1 parent d192938 commit d22e5d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/streaming/socket.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func (sm *SocketManager) ProcessTelemetry(serializer *telemetry.BinarySerializer
go sm.writer()
var rl *rate.RateLimiter

if sm.config.RateLimit != nil {
if sm.config.RateLimit != nil && sm.config.RateLimit.Enabled == true {
rl = rate.New(sm.config.RateLimit.MessageLimit, sm.config.RateLimit.MessageIntervalTimeSecond)
} else {
rl = rate.New(100, 60*time.Second)
Expand Down

0 comments on commit d22e5d7

Please sign in to comment.