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 /state | |
| 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 'state')
| -rw-r--r-- | state/pebble_backend.go | 6 | ||||
| -rw-r--r-- | state/pebble_state.go | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/state/pebble_backend.go b/state/pebble_backend.go index fbb8d68..b510f8f 100644 --- a/state/pebble_backend.go +++ b/state/pebble_backend.go | |||
| @@ -128,3 +128,9 @@ func (p *PebbleStateBackend) deserialize(stateID uint8) []byte { | |||
| 128 | } | 128 | } |
| 129 | return b | 129 | return b |
| 130 | } | 130 | } |
| 131 | |||
| 132 | func (p *PebbleStateBackend) Close() error { | ||
| 133 | return p.db.Close() | ||
| 134 | } | ||
| 135 | |||
| 136 | |||
diff --git a/state/pebble_state.go b/state/pebble_state.go index 3eeaa05..0b60deb 100644 --- a/state/pebble_state.go +++ b/state/pebble_state.go | |||
| @@ -44,7 +44,7 @@ func (p *pebbleStateValue) Value(ctx context.Context) (any, error) { | |||
| 44 | 44 | ||
| 45 | res := core.GetBuffer(len(v)) | 45 | res := core.GetBuffer(len(v)) |
| 46 | copy(res, v) | 46 | copy(res, v) |
| 47 | return v, nil | 47 | return res, nil |
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | func (p *pebbleStateValue) Clear(ctx context.Context) error { | 50 | func (p *pebbleStateValue) Clear(ctx context.Context) error { |
