From 2b3c17faf46bc68f31e7b151c61f7c6ed5b28098 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20Dub=C3=A9?= Date: Tue, 2 Jan 2024 13:36:33 +0000 Subject: [PATCH] remove mutex --- flow/connectors/postgres/postgres.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/flow/connectors/postgres/postgres.go b/flow/connectors/postgres/postgres.go index c905d3d27f..a3f991d747 100644 --- a/flow/connectors/postgres/postgres.go +++ b/flow/connectors/postgres/postgres.go @@ -5,7 +5,6 @@ import ( "fmt" "log/slog" "regexp" - "sync" "time" "github.com/PeerDB-io/peer-flow/connectors/utils" @@ -28,7 +27,6 @@ type PostgresConnector struct { config *protos.PostgresConfig pool *SSHWrappedPostgresPool replConfig *pgxpool.Config - replMutex sync.Mutex replPool *SSHWrappedPostgresPool tableSchemaMapping map[string]*protos.TableSchema customTypesMapping map[uint32]string @@ -91,15 +89,12 @@ func NewPostgresConnector(ctx context.Context, pgConfig *protos.PostgresConfig) }, nil } -// nil returns the connection pool. +// GetPool returns the connection pool. func (c *PostgresConnector) GetPool() *SSHWrappedPostgresPool { return c.pool } func (c *PostgresConnector) GetReplPool(ctx context.Context) (*SSHWrappedPostgresPool, error) { - c.replMutex.Lock() - defer c.replMutex.Unlock() - if c.replPool != nil { return c.replPool, nil }