Skip to content

Commit

Permalink
fix(route/bilibili): remove clear cache logics
Browse files Browse the repository at this point in the history
  • Loading branch information
pseudoyu committed Oct 31, 2024
1 parent 161aeed commit e900ae6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
5 changes: 0 additions & 5 deletions lib/routes/bilibili/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,6 @@ const getCookie = () => {
});
};

const clearCookie = () => {
cache.set('bili-cookie');
};

const getRenderData = (uid) => {
const key = 'bili-web-render-data';
return cache.tryGet(key, async () => {
Expand Down Expand Up @@ -280,7 +276,6 @@ const getArticleDataFromCvid = async (cvid, uid) => {

export default {
getCookie,
clearCookie,
getWbiVerifyString,
getUsernameFromUID,
getUsernameAndFaceFromUID,
Expand Down
3 changes: 1 addition & 2 deletions lib/routes/bilibili/dynamic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,7 @@ async function handler(ctx) {
});
const body = JSONbig.parse(response.body);
if (body?.code === -352) {
cacheIn.clearCookie();
throw new Error('The cookie has expired, please try again.');
throw new Error('Request failed, please try again.');
}
const items = (body as BilibiliWebDynamicResponse)?.data?.items;

Expand Down

0 comments on commit e900ae6

Please sign in to comment.