Skip to content

Commit 0112777

Browse files
orientlubrocaar
authored andcommitted
Remove acquiring read-lock twice (#119)
Closes #118.
1 parent 2d2bbed commit 0112777

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

cmd/lora-gateway-bridge/cmd/root.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ func init() {
3232
rootCmd.PersistentFlags().StringVarP(&cfgFile, "config", "c", "", "path to configuration file (optional)")
3333
rootCmd.PersistentFlags().Int("log-level", 4, "debug=5, info=4, error=2, fatal=1, panic=0")
3434

35+
viper.BindPFlag("general.log_level", rootCmd.PersistentFlags().Lookup("log-level"))
36+
3537
// default values
3638
viper.SetDefault("general.log_level", 4)
3739
viper.SetDefault("backend.type", "semtech_udp")

internal/backend/semtechudp/backend.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,8 +465,6 @@ func (b *Backend) handlePushData(up udpPacket) error {
465465

466466
func (b *Backend) handleStats(gatewayID lorawan.EUI64, stats gw.GatewayStats) {
467467
// set configuration version, if available
468-
b.RLock()
469-
defer b.RUnlock()
470468

471469
for _, c := range b.configurations {
472470
if gatewayID == c.gatewayID {

0 commit comments

Comments
 (0)