CodeIgniter-minify icon indicating copy to clipboard operation
CodeIgniter-minify copied to clipboard

Write files to tmp location first

Open screamingjungle opened this issue 3 years ago • 1 comments

I'm seeing some 'broken' files when the files are being written and webpage views are being done. Perhaps write to a tmp location first and when the write is complete then rename/overwrite to the final location.

screamingjungle avatar May 10 '21 10:05 screamingjungle

To add to this a fix may be to delay the file write by a couple of seconds. What seems to be happening is the files are being compressed while the upload is still taking place resulting in a 'chopped' out_file.

Adding in a sleep delayed the write so the file upload could finish in time. Moving this to a setting could allow some control over it.

if ($compile OR $force) { $this->_concat_files($files_array, $directory, $out_file); } to if ($compile OR $force) { sleep(2); $this->_concat_files($files_array, $directory, $out_file); }

screamingjungle avatar Mar 07 '23 12:03 screamingjungle