be - preprocess - fix path limit crash

This commit is contained in:
slatinsky 2024-09-01 19:17:03 +02:00
parent 969445791d
commit ca633b7449
3 changed files with 6 additions and 2 deletions

View file

@ -4,4 +4,4 @@ import multiprocessing
if __name__ == "__main__":
multiprocessing.freeze_support() # for windows https://stackoverflow.com/a/67590514
uvicorn.run("src.main:app", host="0.0.0.0", port=58000, reload=False, workers=4)
uvicorn.run("src.main:app", host="0.0.0.0", port=58000, reload=False, workers=1, loop="asyncio")

View file

@ -404,7 +404,11 @@ class JsonProcessor:
json_path_with_base_dir = self.file_finder.add_base_directory(json_path)
# get file size
file_size = os.path.getsize(json_path_with_base_dir)
try:
file_size = os.path.getsize(json_path_with_base_dir)
except FileNotFoundError:
print(f' ERROR: FileNotFoundError - path is probably longer than 260 chars')
file_size = 0
# get date modified
date_modified = os.path.getmtime(json_path_with_base_dir)