• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

cameri / nostream / 24634834378

19 Apr 2026 05:24PM UTC coverage: 66.443% (-4.7%) from 71.16%
24634834378

push

github

web-flow
feat: queries benchmarking and optimization  (#68) (#534)

* feat(db): add hot-path indexes and query benchmark (#68)

* docs: added changeset (#68)

* chore: addressed review comments (#68)

* fix: bug fixes in benchmark-queries (#68)

1021 of 1632 branches covered (62.56%)

Branch coverage included in aggregate %.

0 of 111 new or added lines in 1 file covered. (0.0%)

103 existing lines in 20 files now uncovered.

2549 of 3741 relevant lines covered (68.14%)

7.73 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

40.91
/src/cache/client.ts
1
import { createClient, RedisClientOptions } from 'redis'
1✔
2
import { CacheClient } from '../@types/cache'
3
import { createLogger } from '../factories/logger-factory'
1✔
4

5
const debug = createLogger('cache-client')
1✔
6

7
export const getCacheConfig = (): RedisClientOptions => ({
1✔
8
  url: process.env.REDIS_URI
×
9
    ? process.env.REDIS_URI
10
    : `redis://${process.env.REDIS_USER}:${process.env.REDIS_PASSWORD}@${process.env.REDIS_HOST}:${process.env.REDIS_PORT}`,
11
  password: process.env.REDIS_PASSWORD,
12
})
13

14
let instance: CacheClient | undefined = undefined
1✔
15

16
export const getCacheClient = (): CacheClient => {
1✔
UNCOV
17
  if (!instance) {
×
UNCOV
18
    const config = getCacheConfig()
×
19
    // eslint-disable-next-line @typescript-eslint/no-unused-vars
UNCOV
20
    const { password: _, ...loggableConfig } = config
×
UNCOV
21
    debug('config: %o', loggableConfig)
×
UNCOV
22
    instance = createClient(config)
×
23
  }
24

UNCOV
25
  return instance
×
26
}
27

28
export const closeCacheClient = async (): Promise<void> => {
1✔
29
  if (instance?.isOpen) {
1!
UNCOV
30
    await instance.disconnect()
×
UNCOV
31
    instance = undefined
×
32
  }
33
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc