File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,9 @@ def append_chunk(self, chunk: bytes):
3535 )
3636 self ._id += 1
3737
38+ # Expire the stream after 20 minutes
39+ objref_stream_client .expire (self .objref , 1200 )
40+
3841 def finalize (self ):
3942 # Read the stream and finalize the asset
4043 file_bytes = b""
@@ -56,6 +59,9 @@ def finalize(self):
5659 {"chunk" : b"" , "id" : - 1 },
5760 )
5861
62+ # Expire the stream after 20 minutes
63+ objref_stream_client .expire (self .objref , 1200 )
64+
5965 return self ._asset .finalize_streaming_asset (file_bytes )
6066
6167 def read (self , start_index = 0 , timeout = 1000 ):
Original file line number Diff line number Diff line change @@ -78,6 +78,9 @@ async def sheet_error(self, event):
7878 async def _append_event_to_redis (self , event ):
7979 try :
8080 sheet_run_data_store .rpush (self .run_id , json .dumps (event ))
81+
82+ # Expire the stream after 1 day
83+ sheet_run_data_store .expire (self .run_id , 86400 )
8184 except Exception as e :
8285 logger .error (f"Error appending event to Redis: { str (e )} " )
8386
You can’t perform that action at this time.
0 commit comments