Skip to content

Commit 28093e4

Browse files
committed
Close lock on success and error
1 parent 8cf918c commit 28093e4

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/setup-open.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,6 @@ global.onLockContextIsAvailable = async (dbName: string, lockId: ContextLockID)
6868
});
6969
} catch (ex) {
7070
console.error(ex);
71-
} finally {
72-
// Always release a lock once finished
73-
closeContextLock(dbName, lockId);
7471
}
7572
});
7673
};
@@ -122,6 +119,7 @@ export function setupOpen(QuickSQLite: ISQLite) {
122119
closeContextLock(dbName, id);
123120
resolve(res)
124121
} catch (ex) {
122+
closeContextLock(dbName, id);
125123
reject(ex)
126124
} finally {
127125
hooks?.lockReleased?.()

0 commit comments

Comments
 (0)