From d0813205e6975d7eec3f0b168a5c3dd31321231a Mon Sep 17 00:00:00 2001 From: Luka Vandervelden Date: Fri, 24 Jul 2020 13:31:05 +0200 Subject: [PATCH] Locks and exception-resilience. --- src/dodb.cr | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/dodb.cr b/src/dodb.cr index 74e321d..abe2f6d 100644 --- a/src/dodb.cr +++ b/src/dodb.cr @@ -61,6 +61,10 @@ abstract class DODB::Storage(V) release_lock "index" index # FIXME: Should we really return the internal key? + rescue e + release_lock "index" + + raise e end def each(reversed : Bool = false, start_offset = 0, end_offset : Int32? = nil)