UNPKG

@opengis/fastify-table

Version:

core-plugins

14 lines (13 loc) 406 B
import config from "../../../../config.js"; import getRedis from "../../redis/funcs/getRedis.js"; const rclient = getRedis({ db: 0 }); export default async function getOpt(token, uid = 0) { if (!config.redis) return null; const key = `opt:${uid}:${token}`; // console.log(key); const data = await rclient.get(key); if (!data) return null; return JSON.parse(data); }