From 077b55b87f33af0a3b6b0bf2cf929fdf5957c6fa Mon Sep 17 00:00:00 2001 From: Matthew Stratford Date: Wed, 12 May 2021 00:14:35 +0100 Subject: [PATCH] Catch files that can't be removed, skip them. --- file_manager.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/file_manager.py b/file_manager.py index 8e4d2d3..34b818d 100644 --- a/file_manager.py +++ b/file_manager.py @@ -75,7 +75,11 @@ class FileManager: else: filepath = path+"/"+file self.logger.log.info("Removing file {} on new show load.".format(filepath)) - os.remove(filepath) + try: + os.remove(filepath) + except Exception: + self.logger.log.warning("Failed to remove, skipping. Likely file is still in use.") + continue channel_received[channel] = True # If we receive a new status message, let's check for files which have not been pre-loaded.