Skip to content

Commit

Permalink
Fix for fix
Browse files Browse the repository at this point in the history
  • Loading branch information
westsurname authored May 29, 2024
1 parent 60284df commit 6c28bde
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions blackhole.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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)
Expand Down

0 comments on commit 6c28bde

Please sign in to comment.