9 lines
304 B
JavaScript
9 lines
304 B
JavaScript
import { UserKeypairs } from "../models/index.js";
|
|
import { Cache } from "./cache.js";
|
|
const cache = new Cache("keypairStore", 60 * 30);
|
|
export async function getUserKeypair(userId) {
|
|
return await cache.fetch(userId, ()=>UserKeypairs.findOneByOrFail({
|
|
userId: userId
|
|
}), true);
|
|
}
|