From 254206f54b7b7c97b80ce428450c878d713be9d9 Mon Sep 17 00:00:00 2001 From: ryan smith Date: Sun, 16 Jun 2024 23:08:28 -0700 Subject: [PATCH] wpg: remove unused code This functionality has been replaced by explicit mutex management. The shovel task creates a mutex and threads it into the loadinsert and dig.Insert methods. --- wpg/conn.go | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/wpg/conn.go b/wpg/conn.go index d3b534f6..fac5a475 100644 --- a/wpg/conn.go +++ b/wpg/conn.go @@ -54,36 +54,3 @@ func LockHash(s string) int64 { } return n } - -func NewTxLocker(tx pgx.Tx) *TxLocker { - return &TxLocker{tx: tx} -} - -type TxLocker struct { - sync.Mutex - tx pgx.Tx -} - -func (t *TxLocker) QueryRow(ctx context.Context, sql string, args ...any) pgx.Row { - t.Lock() - defer t.Unlock() - return t.tx.QueryRow(ctx, sql, args...) -} - -func (t *TxLocker) Query(ctx context.Context, sql string, args ...any) (pgx.Rows, error) { - t.Lock() - defer t.Unlock() - return t.tx.Query(ctx, sql, args...) -} - -func (t *TxLocker) Exec(ctx context.Context, sql string, args ...any) (pgconn.CommandTag, error) { - t.Lock() - defer t.Unlock() - return t.tx.Exec(ctx, sql, args...) -} - -func (t *TxLocker) CopyFrom(ctx context.Context, table pgx.Identifier, cols []string, source pgx.CopyFromSource) (int64, error) { - t.Lock() - defer t.Unlock() - return t.tx.CopyFrom(ctx, table, cols, source) -}