Skip to content

Commit

Permalink
fix local tso
Browse files Browse the repository at this point in the history
Signed-off-by: okJiang <[email protected]>
  • Loading branch information
okJiang committed Dec 11, 2024
1 parent 422251e commit 3e32eb2
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions oracle/oracles/pd.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,11 +246,7 @@ func (f *tsFuture) Wait() (uint64, error) {

func (o *pdOracle) GetTimestampAsync(ctx context.Context, opt *oracle.Option) oracle.Future {
var ts pd.TSFuture

Check failure on line 248 in oracle/oracles/pd.go

View workflow job for this annotation

GitHub Actions / golangci

S1021: should merge variable declaration with assignment on next line (gosimple)
if opt.TxnScope == oracle.GlobalTxnScope || opt.TxnScope == "" {
ts = o.c.GetTSAsync(ctx)
} else {
ts = o.c.GetLocalTSAsync(ctx, opt.TxnScope)
}
ts = o.c.GetTSAsync(ctx)
return &tsFuture{ts, o, opt.TxnScope}
}

Expand All @@ -260,11 +256,7 @@ func (o *pdOracle) getTimestamp(ctx context.Context, txnScope string) (uint64, e
physical, logical int64
err error
)
if txnScope == oracle.GlobalTxnScope || txnScope == "" {
physical, logical, err = o.c.GetTS(ctx)
} else {
physical, logical, err = o.c.GetLocalTS(ctx, txnScope)
}
physical, logical, err = o.c.GetTS(ctx)
if err != nil {
return 0, errors.WithStack(err)
}
Expand Down

0 comments on commit 3e32eb2

Please sign in to comment.