-
Notifications
You must be signed in to change notification settings - Fork 88
Description
I noticed two cases where temp files are created:
- A %Waffle.File is created with the
binaryfield - convert (or another tool) is called to transform the file
In production, this is dangerous: if the process handling the temp files crashes, temp files are not removed and will dangle, potentially occupying significant storage (even filling it if not cleaned up for a long time).
I see two options here, IMO they must be both implemented:
- Allow to specify the temp dir for waffle, and use it in
Waffle.File.generate_temporary_file - Briefly-like auto temp file deletion
(1) can be used to periodically clean up old files (e.g. > 1 hour)
(2) is the best option, but assumes a %Waffle.File does not cross process boundaries
@achempion I'd like to hear your opinion, maybe there is a better option.
I've seen this be a problem in production and eventually occupy all disk space with old temp files.
EDIT: I wonder if we could do without temp files at all. convert could output/input to/from stdout/stdin, but not sure where else we need explicit files.