From b843da73dd6a487e4cec0e458ec662fb2edbde14 Mon Sep 17 00:00:00 2001 From: sangtran Date: Sat, 5 Sep 2026 23:51:10 +0700 Subject: misc: fix return bug in pebble_state and add on close method cleanup --- main.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'main.go') diff --git a/main.go b/main.go index 91b96e3..2399ceb 100644 --- a/main.go +++ b/main.go @@ -41,9 +41,16 @@ func (t *TransactionSummary[IN, OUT]) Apply(ctx context.Context, key string, win func main() { // init ctx := context.Background() + // memory backend + // backend := state.NewMemoryStateBackend(1) + // pebble backend + backend, err := state.NewPebbleStateBackend("./data_pebble", 1) - backend := state.NewMemoryStateBackend(1) + if err != nil { + panic(err) + } + defer backend.Close() ctx = core.InjectStateBackend(ctx, backend) txList := []Transaction{ -- cgit v1.3.1