@@ -16,7 +16,7 @@ async function get<T>(fetchFromDB: () => Promise<T>, key: string): Promise<T> {
16
16
17
17
const data = await fetchFromDB ( ) ;
18
18
19
- redis . set ( key , JSON . stringify ( data ) ) ;
19
+ redis . set ( key , JSON . stringify ( data ) ) . catch ( ( err ) => Logger . error ( err ) ) ;
20
20
21
21
return data ;
22
22
}
@@ -67,7 +67,7 @@ async function getAndSplit<T, U extends string>(fetchFromDB: (values: U[]) => Pr
67
67
}
68
68
69
69
for ( const key in newResults ) {
70
- redis . set ( key , JSON . stringify ( newResults [ key ] ) ) ;
70
+ redis . set ( key , JSON . stringify ( newResults [ key ] ) ) . catch ( ( err ) => Logger . error ( err ) ) ;
71
71
}
72
72
} ) ;
73
73
}
@@ -77,16 +77,16 @@ async function getAndSplit<T, U extends string>(fetchFromDB: (values: U[]) => Pr
77
77
78
78
function clearSegmentCache ( videoInfo : { videoID : VideoID ; hashedVideoID : VideoIDHash ; service : Service ; userID ?: UserID ; } ) : void {
79
79
if ( videoInfo ) {
80
- redis . del ( skipSegmentsKey ( videoInfo . videoID , videoInfo . service ) ) ;
81
- redis . del ( skipSegmentGroupsKey ( videoInfo . videoID , videoInfo . service ) ) ;
82
- redis . del ( skipSegmentsHashKey ( videoInfo . hashedVideoID , videoInfo . service ) ) ;
83
- if ( videoInfo . userID ) redis . del ( reputationKey ( videoInfo . userID ) ) ;
80
+ redis . del ( skipSegmentsKey ( videoInfo . videoID , videoInfo . service ) ) . catch ( ( err ) => Logger . error ( err ) ) ;
81
+ redis . del ( skipSegmentGroupsKey ( videoInfo . videoID , videoInfo . service ) ) . catch ( ( err ) => Logger . error ( err ) ) ;
82
+ redis . del ( skipSegmentsHashKey ( videoInfo . hashedVideoID , videoInfo . service ) ) . catch ( ( err ) => Logger . error ( err ) ) ;
83
+ if ( videoInfo . userID ) redis . del ( reputationKey ( videoInfo . userID ) ) . catch ( ( err ) => Logger . error ( err ) ) ;
84
84
}
85
85
}
86
86
87
87
function clearRatingCache ( videoInfo : { hashedVideoID : VideoIDHash ; service : Service ; } ) : void {
88
88
if ( videoInfo ) {
89
- redis . del ( ratingHashKey ( videoInfo . hashedVideoID , videoInfo . service ) ) ;
89
+ redis . del ( ratingHashKey ( videoInfo . hashedVideoID , videoInfo . service ) ) . catch ( ( err ) => Logger . error ( err ) ) ;
90
90
}
91
91
}
92
92
0 commit comments