The DRUPAL_MAXIMUM_TEMP_FILE_AGE constant seems too short to handle nodes with large file attachments (audio/video etc.). It's a constant set to 24 minutes. Tell me if I'm wrong but it looks like nodes can have their file attachments deleted before the node is saved, if the process of uploading, previewing, etc. takes more than 24 minutes.
With 100MB of attachments on a node it could easily be an hour long (or more) process to upload files and save the node.
Is there any reason System module is so aggressive about garbage collection of temporary files?
Dries' suggestion at http://drupal.org/node/115267#comment-503595 was to remove the setting from the patch and make it a define. This issue could be resolved by either swapping it back for a setting, or increasing the constant to something like 2 or 3 hours, which should be enough for most sites. Although there certainly can be exceptions here..
| Comment | File | Size | Author |
|---|---|---|---|
| #8 | d7-MAXIMUM_TEMP_FILE_AGE.patch | 651 bytes | mfb |
| #3 | maximum_temp_file_age.patch | 1.4 KB | mfb |
| #1 | maximum_temp_file_age.patch | 601 bytes | mfb |
Comments
Comment #1
mfbHere's a suggested fix, increasing the maximum temp file age from 24 minutes to 4 hours. Attached patch is for HEAD.
Comment #2
R.Muilwijk commentedMost of the sites wouldn't want the temp file age to be that long. The variable is also just used on 2 places. The declaration and the query:
Why not make a variable of it so people can adjust to their needs with a default of 24 minutes? Though it would be nice to add some documentation of why 24 minutes.
Comment #3
mfbI don't have a strong preference for either solution. Although if there is some reason why some sites would prefer only 24 minute life for temporary files then I suppose it should be a variable, since I definitely need a couple hours to handle more than one large file attachment.
Comment #4
mfbIf forms are cached for six hours (21600 seconds), then why not allow temporary files to also live for up to six hours? Or at least four hours as in my patch above.
Comment #5
drewish commentedif you look at dopry's early patches before the constant was added, it was 14400 (4 hours). i'm guessing that the zero got dropped during the copy-paste to the constant.
update: whoops... looking at the next patch it's pretty clear that i'm the one that dropped the zero.
Comment #6
drewish commentedi think the timelimit needs to be fixed as part of this patch. i'm not sure it needs to be a variable though.
Comment #7
damien tournoud commentedI like the idea of aligning that to the FormAPI cache cleaning.
Comment #8
mfbok here's a 6 hour version... longer than I need but I guess theoretically someone could spend most of a day's work uploading attachments and previewing.. (it won't allow people to get 8 hours sleep while uploading attachments).
Comment #9
obsidiandesign commentedPatch applies cleanly. I agree that matching FormAPI's cache time is a good approach. SimpleTests run successfully. +1 for RTBC.
Comment #10
lilou commentedComment #11
dries commentedCommitted to CVS HEAD and DRUPAL-6. Thanks! :)
Comment #12
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.