mirror of
https://github.com/PostHog/posthog.git
synced 2024-11-28 00:46:45 +01:00
13 lines
414 B
TypeScript
13 lines
414 B
TypeScript
import { CdpRedis } from '../../../src/cdp/redis'
|
|
|
|
export async function deleteKeysWithPrefix(redis: CdpRedis, prefix: string) {
|
|
await redis.useClient({ name: 'delete-keys' }, async (client) => {
|
|
const keys = await client.keys(`${prefix}*`)
|
|
const pipeline = client.pipeline()
|
|
keys.forEach(function (key) {
|
|
pipeline.del(key)
|
|
})
|
|
await pipeline.exec()
|
|
})
|
|
}
|