point-e icon indicating copy to clipboard operation
point-e copied to clipboard

Cleanup fetch_file_cached() operations in the download model

Open Arkay92 opened this issue 2 years ago • 3 comments

Old data was being left behind using os.rename. By switching to shutil we can move the file and delete the old cache data so temp files are properly cleaned up.

Arkay92 avatar Dec 27 '22 18:12 Arkay92

Hello,

shutil is part of the standard library so it should not be added to setup.py

dancergraham avatar Dec 28 '22 15:12 dancergraham

My bad good spot graham will undo with a new commit

Arkay92 avatar Dec 28 '22 16:12 Arkay92

You're very welcome ! Also on a point of personal preference I would remove code comments which say what the code is doing - that should be clear from the code. I think comments should explain why and the code itself should be clear. For instance the comment below is not needed because the code itself is very clear:

    # Return local path
    return local_path

dancergraham avatar Dec 28 '22 16:12 dancergraham