Skip to content

Commit 8aea564

Browse files
committed
Version 1.0
1 parent 4315273 commit 8aea564

File tree

3 files changed

+18
-17
lines changed

3 files changed

+18
-17
lines changed

.github/workflows/npm-publish.yml

+13-13
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,16 @@ jobs:
4040
- run: npm run lint
4141
- run: ./scripts/example-check.sh
4242

43-
# publish:
44-
# needs: ["test", "lint"]
45-
# runs-on: ubuntu-latest
46-
47-
# steps:
48-
# - uses: actions/checkout@v4
49-
# - uses: actions/setup-node@v4
50-
# with:
51-
# node-version: 20
52-
# - run: npm ci
53-
# - uses: JS-DevTools/npm-publish@v1
54-
# with:
55-
# token: ${{ secrets.NPM_TOKEN }}
43+
publish:
44+
needs: ["test", "lint"]
45+
runs-on: ubuntu-latest
46+
47+
steps:
48+
- uses: actions/checkout@v4
49+
- uses: actions/setup-node@v4
50+
with:
51+
node-version: 20
52+
- run: npm ci
53+
- uses: JS-DevTools/npm-publish@v1
54+
with:
55+
token: ${{ secrets.NPM_TOKEN }}

README.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ const logger = createLogger();
1515
const redisClient = new Redis();
1616

1717
const cache = new Cache(
18-
"users:{userId}",
19-
// Caches will be checked in order, and the first cache to return a value
20-
// will be used
18+
// Keys should be prefixed with the project name to make them unique across
19+
// all of LOKE
20+
"foo-service:users:fetch:{userId}",
21+
// Cache stores will be checked in order, and the first cache to return a
22+
// value will be used
2123
[new LruMemoryCacheStore({ max: 1000 }), new RedisCacheStore(redisClient)],
2224
logger,
2325
);

src/redis.ts

-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ export class RedisCacheStore<T> implements CacheStore<T> {
4444
const buf = Buffer.from(JSON.stringify(record), "utf8");
4545

4646
if (this.keyTemplate !== null) {
47-
// JS UTF-16 is 2 bytes per char, 🤞redis client isn't using utf8
4847
cacheValueSize.observe({ key: this.keyTemplate }, buf.length);
4948
}
5049

0 commit comments

Comments
 (0)