Skip to content

Commit 0e106cf

Browse files
authored
Merge pull request #1782 from augchan42/fix/twitter-profile-cache-1638
fix: remove twitter profile caching (#1638)
2 parents ed16b0c + 6b0ae6e commit 0e106cf

File tree

1 file changed

+1
-22
lines changed

1 file changed

+1
-22
lines changed

packages/client-twitter/src/base.ts

+1-22
Original file line numberDiff line numberDiff line change
@@ -729,28 +729,10 @@ export class ClientBase extends EventEmitter {
729729
);
730730
}
731731

732-
async getCachedProfile(username: string) {
733-
return await this.runtime.cacheManager.get<TwitterProfile>(
734-
`twitter/${username}/profile`
735-
);
736-
}
737-
738-
async cacheProfile(profile: TwitterProfile) {
739-
await this.runtime.cacheManager.set(
740-
`twitter/${profile.username}/profile`,
741-
profile
742-
);
743-
}
744-
745732
async fetchProfile(username: string): Promise<TwitterProfile> {
746-
const cached = await this.getCachedProfile(username);
747-
748-
if (cached) return cached;
749-
750733
try {
751734
const profile = await this.requestQueue.add(async () => {
752735
const profile = await this.twitterClient.getProfile(username);
753-
// console.log({ profile });
754736
return {
755737
id: profile.userId,
756738
username,
@@ -767,13 +749,10 @@ export class ClientBase extends EventEmitter {
767749
} satisfies TwitterProfile;
768750
});
769751

770-
this.cacheProfile(profile);
771-
772752
return profile;
773753
} catch (error) {
774754
console.error("Error fetching Twitter profile:", error);
775-
776-
return undefined;
755+
throw error;
777756
}
778757
}
779758
}

0 commit comments

Comments
 (0)