Skip to content

Commit

Permalink
catch os error
Browse files Browse the repository at this point in the history
  • Loading branch information
DeekshithSH committed May 11, 2024
1 parent 6a7bd83 commit d04c5cb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions WebStreamer/utils/custom_dl.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,12 @@ async def yield_file(
await cdn_session.stop()
except (TimeoutError, AttributeError):
pass
except OSError as e:
logging.info("Removing Media Session")
client.media_sessions.pop(file_id.dc_id, None)
await media_session.stop()
logging.error(e)
raise e
finally:
logging.debug(f"Finished yielding file with {current_part} parts.")
work_loads[file_id.index] -= 1
Expand Down

0 comments on commit d04c5cb

Please sign in to comment.