Skip to content

Commit 05e802e

Browse files
author
Greg Perkins
committed
tweaks
1 parent 7d8e556 commit 05e802e

File tree

5 files changed

+11
-15
lines changed

5 files changed

+11
-15
lines changed

CHANGELOG.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
# Change Log
22

3-
## [3.5.0]
3+
## [4.0.0]
44
### Changed
5-
- Added Postgres as a possible backing store (required adding an async initialize to the storage interface and making the shutdown routine async).
6-
- Note: **THIS IS A BREAKING CHANGE** because `storage.initialize()` needs to be called to ensure your backing store is up and running (if your code needs to be portable across all backing stores).
5+
- Added Postgres as a supported backing store
6+
(doing so required adding an async `initialize()` to the storage interface
7+
and making the interface's `shutdown()` routine async).
8+
- Note: **THIS IS A BREAKING CHANGE** because `storage.initialize()` now
9+
needs to be called to ensure your backing store is up and running
10+
(well, if your code needs to work properly across all possible backing stores).
711

812

913
## [3.4.0]
@@ -28,6 +32,7 @@
2832

2933

3034
[unreleased]: https://github.com/ForstaLabs/librelay-node/tree/master
35+
[4.0.0]: https://github.com/ForstaLabs/librelay-node/tree/v4.0.0
3136
[3.4.0]: https://github.com/ForstaLabs/librelay-node/tree/v3.4.0
3237
[3.3.0]: https://github.com/ForstaLabs/librelay-node/tree/v3.3.0
3338
[3.2.0]: https://github.com/ForstaLabs/librelay-node/tree/v3.2.0

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ librelay on a single backing store use
3636
`librelay.storage.setLabel('<something-unique>')` to shard your storage into
3737
a unique namespace.
3838

39-
You'll need to ensure your backing store is running properly with a call to (async) `librelay.storage.initialize()`,
40-
and if possible you should tear it down before quitting, with (async) `librelay.storage.shutdown()`.
39+
You'll need to ensure your backing store is running properly with a call
40+
to (async) `librelay.storage.initialize()`, and if possible you should
41+
tear it down before quitting, with (async) `librelay.storage.shutdown()`.
4142

4243

4344
Provisioning

src/storage/backing/fs.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,6 @@ class FSBacking extends StorageInterface {
8787
this.root = path.join(os.homedir(), '.librelay/storage', label, 'v' + version);
8888
}
8989

90-
async initialize() {
91-
}
92-
9390
async set(ns, key, value) {
9491
const dir = path.join(this.root, ns);
9592
for (let i = 0; i < 2; i++) {
@@ -143,9 +140,6 @@ class FSBacking extends StorageInterface {
143140
}
144141
return regex ? keys.filter(x => x.match(regex)) : keys;
145142
}
146-
147-
async shutdown() {
148-
}
149143
}
150144

151145
module.exports = FSBacking;

src/storage/backing/postgres.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ class PostgresBacking extends StorageInterface {
6565
}
6666

6767
async shutdown() {
68-
console.log('postgres shutting down');
6968
await this.client.end();
7069
this.client = null;
7170
}

src/storage/backing/redis.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,6 @@ class RedisBacking extends StorageInterface {
5858
this.client = AsyncRedisClient.createClient(process.env.REDIS_URL);
5959
}
6060

61-
async initialize() {
62-
}
63-
6461
async set(ns, key, value) {
6562
if (value === undefined) {
6663
throw new Error("Tried to store undefined");

0 commit comments

Comments
 (0)