File tree 1 file changed +1
-22
lines changed
1 file changed +1
-22
lines changed Original file line number Diff line number Diff line change @@ -729,28 +729,10 @@ export class ClientBase extends EventEmitter {
729
729
) ;
730
730
}
731
731
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
-
745
732
async fetchProfile ( username : string ) : Promise < TwitterProfile > {
746
- const cached = await this . getCachedProfile ( username ) ;
747
-
748
- if ( cached ) return cached ;
749
-
750
733
try {
751
734
const profile = await this . requestQueue . add ( async ( ) => {
752
735
const profile = await this . twitterClient . getProfile ( username ) ;
753
- // console.log({ profile });
754
736
return {
755
737
id : profile . userId ,
756
738
username,
@@ -767,13 +749,10 @@ export class ClientBase extends EventEmitter {
767
749
} satisfies TwitterProfile ;
768
750
} ) ;
769
751
770
- this . cacheProfile ( profile ) ;
771
-
772
752
return profile ;
773
753
} catch ( error ) {
774
754
console . error ( "Error fetching Twitter profile:" , error ) ;
775
-
776
- return undefined ;
755
+ throw error ;
777
756
}
778
757
}
779
758
}
You can’t perform that action at this time.
0 commit comments