From c438c158fc24a10441245341ce032ae23d0bf052 Mon Sep 17 00:00:00 2001 From: Roy Crihfield Date: Sun, 14 May 2023 02:32:09 +0800 Subject: [PATCH] Deregister groupcache on close --- postgres/v0/database.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/postgres/v0/database.go b/postgres/v0/database.go index 4872df4..c59f34d 100644 --- a/postgres/v0/database.go +++ b/postgres/v0/database.go @@ -278,9 +278,10 @@ func (d *Database) NewIterator(prefix []byte, start []byte) ethdb.Iterator { return NewIterator(start, prefix, d.db) } -// Close satisfies the io.Closer interface -// Close closes the db connection +// Close satisfies the io.Closer interface. +// Close closes the db connection and deregisters from groupcache. func (d *Database) Close() error { + groupcache.DeregisterGroup(d.cache.Name()) return d.db.DB.Close() }