From 565435b64a72aa221f01aae653c24008b5b4ad36 Mon Sep 17 00:00:00 2001 From: Ankit Kumar Sinha <46916395+a9kitkumarsinha@users.noreply.github.com> Date: Wed, 10 Jun 2020 16:21:34 +0800 Subject: [PATCH] Add a compact before close (#30) * Add a compact before close * Add a compact before close * Fix the order * Add a compact before close --- internal/storage/compact/compact.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/storage/compact/compact.go b/internal/storage/compact/compact.go index ef139ceb..54e4a33e 100644 --- a/internal/storage/compact/compact.go +++ b/internal/storage/compact/compact.go @@ -175,5 +175,6 @@ func (s *Storage) merge(keys []key.Key, blocks []block.Block, schema typeof.Sche // Close is used to gracefully close storage. func (s *Storage) Close() error { s.compact.Cancel() + s.Compact(context.Background()) return storage.Close(s.buffer, s.dest) }