UNPKG

@opengis/fastify-table

Version:

core-plugins

15 lines (11 loc) 381 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); }