Skip to content
This repository was archived by the owner on Mar 23, 2023. It is now read-only.

Commit 7a8f9ff

Browse files
authored
fix: pass options to tiered put (#108)
Ensure we can abort put operations by passing options into the wrapped datastores.
1 parent 7e56180 commit 7a8f9ff

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

src/index.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
import * as ErrorsImport from './errors.js'
2-
import * as ShardImport from './shard.js'
3-
41
export { BaseDatastore } from './base.js'
52
export { MemoryDatastore } from './memory.js'
63
export { KeyTransformDatastore } from './keytransform.js'
@@ -9,8 +6,8 @@ export { MountDatastore } from './mount.js'
96
export { TieredDatastore } from './tiered.js'
107
export { NamespaceDatastore } from './namespace.js'
118

12-
export const Errors = ErrorsImport
13-
export const shard = ShardImport
9+
export * as Errors from './errors.js'
10+
export * as shard from './shard.js'
1411

1512
/**
1613
* @typedef {import("./types").Shard } Shard

src/tiered.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,11 @@ export class TieredDatastore extends BaseDatastore {
4949
/**
5050
* @param {Key} key
5151
* @param {Uint8Array} value
52+
* @param {Options} [options]
5253
*/
53-
async put (key, value) {
54+
async put (key, value, options) {
5455
try {
55-
await Promise.all(this.stores.map(store => store.put(key, value)))
56+
await Promise.all(this.stores.map(store => store.put(key, value, options)))
5657
} catch (err) {
5758
throw Errors.dbWriteFailedError()
5859
}

0 commit comments

Comments
 (0)