Commit ·
dc6febb
1
Parent(s): 8fde8ae
Slight Edit
Browse filesFiles changed (2)
24 unmodified lines25262728293031323334353624 unmodified linestry:path = request.match_info["path"]return await media_streamer(request, path, "FAST")except InvalidHash as e:raise web.HTTPForbidden(text=e.message)except FIleNotFound as e:raise web.HTTPNotFound(text=e.message)except (AttributeError, BadStatusLine, ConnectionResetError):pass # Handle expected errors silentlyexcept Exception as e:logging.error(f"Error while streaming file: {str(e)}")traceback.print_exc()24 unmodified lines252627282930313233343536373839404124 unmodified linestry:path = request.match_info["path"]return await media_streamer(request, path, "FAST")except InvalidHash as e:raise web.HTTPForbidden(text=e.message)except FIleNotFound as e:raise web.HTTPNotFound(text=e.message)except (AttributeError, BadStatusLine, ConnectionResetError):pass # Handle expected errors silentlyexcept Exception as e:logging.error(f"Error while streaming file: {str(e)}")traceback.print_exc()
28 unmodified lines2930313233343528 unmodified linesself.clean_timer = 30 * 60 # Cache cleanup timer set to 30 minutesself.client: Client = clientself.cached_file_ids: Dict[str, FileId] = {} # Cache to store file properties by db_idself.last_activity: float = Optional[float] # Track last activity time for the clientasyncio.create_task(self.clean_cache()) # Start the cache cleanup taskdef update_last_activity(self):28 unmodified lines2930313233343528 unmodified linesself.clean_timer = 30 * 60 # Cache cleanup timer set to 30 minutesself.client: Client = clientself.cached_file_ids: Dict[str, FileId] = {} # Cache to store file properties by db_idself.last_activity: float = asyncio.get_event_loop().time() # Track last activity time for the clientasyncio.create_task(self.clean_cache()) # Start the cache cleanup taskdef update_last_activity(self):
FileStream/server/API/downloads.py+5
FileStream/utils/FileProcessors/custom_dl.py+1-1