File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -141,7 +141,7 @@ export const createChatContext = async (
141141 chatExpireTime ,
142142 ) ;
143143 const indexKey = userChatsIndexKey ( userId , projectId ) ;
144- await cacheWrapper . addToSet ( indexKey , chatId , chatExpireTime ) ;
144+ await cacheWrapper . addToSet ( indexKey , chatId ) ;
145145} ;
146146
147147export const getChatContext = async (
Original file line number Diff line number Diff line change @@ -73,16 +73,12 @@ const getBufferAndDelete = async (key: string): Promise<Buffer | null> => {
7373 throw new Error ( 'Not implemented' ) ;
7474} ;
7575
76- const addToSet = async (
77- key : string ,
78- member : string ,
79- expireInSeconds : number = DEFAULT_EXPIRE_TIME / 1000 ,
80- ) : Promise < void > => {
76+ const addToSet = async ( key : string , member : string ) : Promise < void > => {
8177 const existing = ( await getSerializedObject < string [ ] > ( key ) ) ?? [ ] ;
8278 if ( ! existing . includes ( member ) ) {
8379 existing . push ( member ) ;
8480 }
85- await setSerializedObject ( key , existing , expireInSeconds ) ;
81+ await setSerializedObject ( key , existing ) ;
8682} ;
8783
8884const removeFromSet = async ( key : string , member : string ) : Promise < void > => {
Original file line number Diff line number Diff line change @@ -59,17 +59,9 @@ async function setSerializedObject<T>(
5959 await setKey ( key , JSON . stringify ( obj ) , expireInSeconds ) ;
6060}
6161
62- const addToSet = async (
63- key : string ,
64- member : string ,
65- expireInSeconds ?: number ,
66- ) : Promise < void > => {
62+ const addToSet = async ( key : string , member : string ) : Promise < void > => {
6763 const redis = getRedisClient ( ) ;
6864 await redis . sadd ( key , member ) ;
69-
70- if ( expireInSeconds && expireInSeconds > 0 ) {
71- await redis . expire ( key , expireInSeconds ) ;
72- }
7365} ;
7466
7567const removeFromSet = async ( key : string , member : string ) : Promise < void > => {
You can’t perform that action at this time.
0 commit comments