fix(xcxApi): change redis cache key
This commit is contained in:
parent
54d275796e
commit
2032cec715
@ -34,11 +34,11 @@ export class XCXAPI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getAdvProfile(uid: string) {
|
async getAdvProfile(uid: string) {
|
||||||
const cacheProfile = await redis.get(`my-kaiqiuwang-profile:${uid}`);
|
const cacheProfile = await redis.get(`my-kaiqiuwang:profile:${uid}`);
|
||||||
if (!cacheProfile) {
|
if (!cacheProfile) {
|
||||||
const url = `/api/User/adv_profile?uid=${uid}`;
|
const url = `/api/User/adv_profile?uid=${uid}`;
|
||||||
const profile = await this.#fetch<XCXProfile>(url);
|
const profile = await this.#fetch<XCXProfile>(url);
|
||||||
await redis.setex(`my-kaiqiuwang-profile:${uid}`, 60 * 10, JSON.stringify(profile));
|
await redis.setex(`my-kaiqiuwang:profile:${uid}`, 60 * 10, JSON.stringify(profile));
|
||||||
return profile;
|
return profile;
|
||||||
}
|
}
|
||||||
return JSON.parse(cacheProfile);
|
return JSON.parse(cacheProfile);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user