mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-14 19:44:52 +00:00
feat(server): added keystore and made server cfg fetch from keystore to avoid db calls
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import { Redis } from "ioredis";
|
||||
|
||||
export type TKeyStoreFactory = ReturnType<typeof keyStoreFactory>;
|
||||
|
||||
export const keyStoreFactory = (redisUrl: string) => {
|
||||
const redis = new Redis(redisUrl);
|
||||
|
||||
const setItem = async (key: string, value: string | number | Buffer) => redis.set(key, value);
|
||||
|
||||
const getItem = async (key: string) => redis.get(key);
|
||||
|
||||
return { setItem, getItem };
|
||||
};
|
||||
Reference in New Issue
Block a user