Skip to content

Commit

Permalink
change gcworker example
Browse files Browse the repository at this point in the history
  • Loading branch information
weedge committed Jun 7, 2023
1 parent 044325d commit caa8ccf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion examples/gcworker/gcworker.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"time"

"github.com/tikv/client-go/v2/oracle"
"github.com/tikv/client-go/v2/tikv"
"github.com/tikv/client-go/v2/txnkv"
)

Expand All @@ -36,10 +37,14 @@ func main() {
panic(err)
}

sysSafepoint, err := client.GC(context.Background(), *safepoint)
sysSafepoint, err := client.GC(context.Background(), *safepoint, tikv.WithConcurrency(10))
if err != nil {
panic(err)
}
fmt.Printf("Finished GC, expect safepoint:%d(%+v),real safepoint:%d(+%v)\n", *safepoint, oracle.GetTimeFromTS(*safepoint), sysSafepoint, oracle.GetTimeFromTS(sysSafepoint))

err = client.Close()
if err != nil {
panic(err)
}
}

0 comments on commit caa8ccf

Please sign in to comment.