diff options
| author | sangtran <tranquangsang12.7@gmail.com> | 2026-09-05 23:51:10 +0700 |
|---|---|---|
| committer | sangtran <tranquangsang12.7@gmail.com> | 2026-09-05 23:51:10 +0700 |
| commit | b843da73dd6a487e4cec0e458ec662fb2edbde14 (patch) | |
| tree | bc5e378677381db1b52cc56b0756fb06670ded8a /main.go | |
| parent | e626cee8f7de0dd3ffca4c7297e59a87f790cc02 (diff) | |
| signature | Verified sangtran <tranquangsang12.7@gmail.com> Key: 8DD79823D235E1BB ultimate trust | |
| download | flux-b843da73dd6a487e4cec0e458ec662fb2edbde14.tar.gz flux-b843da73dd6a487e4cec0e458ec662fb2edbde14.zip | |
Verified misc: fix return bug in pebble_state and add on close method cleanup
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 9 |
1 files changed, 8 insertions, 1 deletions
| @@ -41,9 +41,16 @@ func (t *TransactionSummary[IN, OUT]) Apply(ctx context.Context, key string, win | |||
| 41 | func main() { | 41 | func main() { |
| 42 | // init | 42 | // init |
| 43 | ctx := context.Background() | 43 | ctx := context.Background() |
| 44 | // memory backend | ||
| 45 | // backend := state.NewMemoryStateBackend(1) | ||
| 46 | // pebble backend | ||
| 47 | backend, err := state.NewPebbleStateBackend("./data_pebble", 1) | ||
| 44 | 48 | ||
| 45 | backend := state.NewMemoryStateBackend(1) | 49 | if err != nil { |
| 50 | panic(err) | ||
| 51 | } | ||
| 46 | 52 | ||
| 53 | defer backend.Close() | ||
| 47 | ctx = core.InjectStateBackend(ctx, backend) | 54 | ctx = core.InjectStateBackend(ctx, backend) |
| 48 | 55 | ||
| 49 | txList := []Transaction{ | 56 | txList := []Transaction{ |
