danpu icon indicating copy to clipboard operation
danpu copied to clipboard

Remove cache file if backup returns an error

Open tvb opened this issue 11 years ago • 4 comments

I noticed danpu will place files of 0 bytes (i.e.: Rah_Danpu_CpCOO0) in the temporary folder if the backup fails for any reason (like unable to connect). Those should be removed to keep the working directory clean.

tvb avatar May 13 '14 20:05 tvb

Hmm, seems https://github.com/gocom/danpu/blob/master/src/Rah/Danpu/Base.php#L223 is not called in case of a failure?

tvb avatar May 13 '14 20:05 tvb

The clean up is called on shutdown process via destructor method. The only case when it won't be called should be when the process dies on a FATAL error (e.g. when one doesn't capture exceptions, or the process terminates unexpectedly before normal shutdown) or other member in the shutdown chain kills the process.

gocom avatar May 16 '14 13:05 gocom

Not sure why the tmp files remain then. I will see if I can reproduce the issue.

tvb avatar May 16 '14 17:05 tvb

Or unable to connect is treated as FATAL?

tvb avatar May 16 '14 17:05 tvb