From 6c28bde722a938672738885daf33a0e456c409fc Mon Sep 17 00:00:00 2001 From: westsurname <155189104+westsurname@users.noreply.github.com> Date: Wed, 29 May 2024 12:53:18 -0400 Subject: [PATCH] Fix for fix --- blackhole.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/blackhole.py b/blackhole.py index cf3357f..c1adf03 100644 --- a/blackhole.py +++ b/blackhole.py @@ -255,6 +255,9 @@ async def processFile(file: TorrentFileInfo, arr: Arr, isRadarr): def print(*values: object): _print(f"[{file.fileInfo.filenameWithoutExt}]", *values) + await asyncio.sleep(1) # Wait before processing the file in case it isn't fully written yet. + os.renames(file.fileInfo.filePath, file.fileInfo.filePathProcessing) + from concurrent.futures import ThreadPoolExecutor def read_file(path): @@ -274,9 +277,6 @@ async def is_accessible(path, timeout=10): finally: executor.shutdown(wait=False) - await asyncio.sleep(1) # Wait before processing the file in case it isn't fully written yet. - os.renames(file.fileInfo.filePath, file.fileInfo.filePathProcessing) - with open(file.fileInfo.filePathProcessing, 'rb' if file.torrentInfo.isDotTorrentFile else 'r') as f: fileData = f.read() f.seek(0)