Skip to content

Commit

Permalink
wpg: remove unused code
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ryandotsmith committed Jun 17, 2024
1 parent 0c428bb commit 254206f
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions wpg/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

0 comments on commit 254206f

Please sign in to comment.