Skip to content

Commit

Permalink
Make isOpen return false while the database is closing
Browse files Browse the repository at this point in the history
  • Loading branch information
Hexagon committed Jun 7, 2024
1 parent 29eca14 commit 4aeb442
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## Unrelesed

## 0.15.9

- Fix `isOpen´ to return false while closing the database

## 0.15.8

- Remove sync result `noop` as isn't used anywhere anymore.
Expand Down
4 changes: 2 additions & 2 deletions deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cross/kv",
"version": "0.15.8",
"version": "0.15.9",
"exports": {
".": "./mod.ts",
"./cli": "./src/cli/mod.ts"
Expand All @@ -10,7 +10,7 @@
"@cross/runtime": "jsr:@cross/runtime@^1.0.0",
"@cross/test": "jsr:@cross/test@^0.0.9",
"@cross/utils": "jsr:@cross/utils@^0.13.0",
"@std/assert": "jsr:@std/assert@^0.225.3",
"@std/assert": "jsr:@std/assert@^0.226.0",
"@std/path": "jsr:@std/path@^0.225.1",
"cbor-x": "npm:cbor-x@^1.5.9"
},
Expand Down
2 changes: 1 addition & 1 deletion src/lib/kv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ export class KV extends EventEmitter {
* @returns True if open, false if closed.
*/
public isOpen(): boolean {
return !!this.ledger && this.ledger.isOpen();
return !this.aborted && !!this.ledger && this.ledger.isOpen();
}

/**
Expand Down

0 comments on commit 4aeb442

Please sign in to comment.