As this module is most often used with Views Data Export, we're considering adding the simple workaround for the Views Data EXport issue #2198399 to alt_stream_wrappers (the workaround is an implementation of hook_file_presave - see the patch in the issue).

This would be a pragmatic way to avoid a build up of lots of temporary files which are marked as permanent and never get cleaned up.

We've talked about adding it within the main module but including a variable whereby the hook can easily be disabled. Alternatively we could make a tiny sub-module which implements the hook. It would then be easy to switch that sub-module on or off as applicable.

Comments

magtak’s picture

This sub-module (naming might be bad) should fix the issue. Good idea might be to actually create a small UI to turn it on/off on demand if enabling/disabling the module does not prove to be convenient.

magtak’s picture

wrong function name :/

magtak’s picture

and typo on the correction.

mcdruid’s picture

mcdruid’s picture

Thanks magtak, this is looking good.

Couple of suggestions:

description = Makes large files created via views_data_export batches temporary so cron can eventually remove them.

How about something like:

description = Ensures views_data_export temporary files are really temporary; see https://www.drupal.org/node/2198399

Also, how about an install hook to (carefully) mark any existing VDE managed files as temporary?

Personally I wouldn't bother with a UI as this sub-module only does one thing; I think enabling/disabling the module itself should be sufficient.

magtak’s picture

I'll work on the hook_install. Feel free to modify the description/title and even the name of the module should something more appropriate/shorter/catchy spring to mind.

  • mcdruid committed 4581af3 on 7.x-1.x authored by magtak
    Issue #2292273 by magtak: Tiny sub-module to provide a workaround for...
mcdruid’s picture

Status: Active » Needs work

Initial sub-module committed, but marking issue as Needs work as the install hook is pending.

Thanks magtak!

mcdruid’s picture

Not that the original VDE issue that we were working around has been fixed: #2198399: temporary files are created as FILE_STATUS_PERMANENT

So...

  • We should probably remove this workaround from alt_stream_wrappers
  • Perhaps the retrospective mark old temp files as really temporary update hook should go into VDE itself?

  • mcdruid committed 93717ad on 7.x-1.x
    #2292273 by mcdruid, magtak: Removing the VDE temp files workaround, as...
mcdruid’s picture

Status: Needs work » Fixed

Removed the workaround sub-module as the bug's been fixed upstream; closing issue.

An update hook in VDE itself might still be a good idea to mark existing files as temporary.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.