Files
chatgpt-ui/utils/keyv.js
2023-02-11 17:37:20 +08:00

15 lines
321 B
JavaScript

import Keyv from 'keyv'
const cacheOptions = {
namespace: 'settings',
uri: 'sqlite://database.sqlite',
}
const cache = new Keyv(cacheOptions);
export const getSetting = async (key) => {
return await cache.get(key)
}
export const setSetting = async (key, value) => {
return await cache.set(key, value)
}