You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So the reason why I was using exec rather than a series of two execFile calls here is that get_file_type could get called multiple times concurrently, which would make the logic for determining when the unzipped file can be deleted very convoluted. Or it could just unzip the file to a new temp file every request, which is also pretty gross. The current method is still unzipping the file every request, but it's at least being auto cleaned up (cause it never hits the FS.)
I've just thought of one solution: unzip and identify the mime types for all files when the zip is first downloaded, and store the results in the CacheEntry (also when restarting the server and loading cached zips.) I'd probably do it by unzipping the entire file into temp at once. Some of the comp zips are over 1GB, and I don't know what their unzipped size would be. This would make initial downloads somewhat slower. Possibly a lot slower?
You know how I said that I'd leave
as-is until it caused a problem? It causes a problem.
In the logs, I see two examples:
I believe both are caused by the shell getting confused by filenames.
I'm not interested in playing whack-a-mole with shell escapes. We need to use execFile().
(Reading the data and then writing it into a separate execFile('file') is okay.)
The text was updated successfully, but these errors were encountered: