Skip to content

Commit

Permalink
rm unnecessary locking
Browse files Browse the repository at this point in the history
  • Loading branch information
FZambia committed Dec 9, 2024
1 parent 48ae424 commit 6df4c9d
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions internal/consuming/postgresql.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"errors"
"fmt"
"strconv"
"sync"
"time"

"github.com/centrifugal/centrifugo/v5/internal/configtypes"
Expand Down Expand Up @@ -175,7 +174,6 @@ func (c *PostgresConsumer) processOnce(ctx context.Context, partition int) (int,

var dispatchErr error

var mu sync.Mutex
for _, event := range events {
dispatchErr = c.dispatcher.Dispatch(context.Background(), event.Method, event.Payload)
if dispatchErr != nil {
Expand All @@ -184,9 +182,7 @@ func (c *PostgresConsumer) processOnce(ctx context.Context, partition int) (int,
break
} else {
numProcessedRows++
mu.Lock()
idsToDelete = append(idsToDelete, event.ID)
mu.Unlock()
}
}

Expand Down

0 comments on commit 6df4c9d

Please sign in to comment.