Temp files not deleted #20

Closed
mattlockyer opened this Issue Jan 30, 2013 · 4 comments

Comments

2 participants
@mattlockyer

Hi I'm using your module with supervisor and have set up my server to recompile all my js and css when the server reboots due to a file change.

Problem is that your code seems to spit out a lot of temp files and not cleaning them up.

Is there any way you can add a simple -cleanup style parameter to the options so these can be deleted automatically?

Thanks 💃

@srod

This comment has been minimized.

Show comment Hide comment
@srod

srod Jan 31, 2013

Owner

Hi,

Temp files are deleting with "_fs.unlinkSync(self.tempFile)".
What options do you use ?

Owner

srod commented Jan 31, 2013

Hi,

Temp files are deleting with "_fs.unlinkSync(self.tempFile)".
What options do you use ?

@mattlockyer

This comment has been minimized.

Show comment Hide comment
@mattlockyer

mattlockyer Jan 31, 2013

Well all I'm doing is calling your method:

new compressor.minify({
type: 'no-compress',
fileIn: files,
fileOut: 'public/css/main.min.css',
tempPath: '../tmp',
callback: function(err){
console.log("Compressed CSS, error: " + err);
checkCompleted();
}
});

Perhaps when I'm using supervisor it's stopping and restarting before your callbacks can be called and the temp files deleted?

It basically looks when files are modified and then reboots the server.

Do you perform all the cleanup before the final file is outputted?

Well all I'm doing is calling your method:

new compressor.minify({
type: 'no-compress',
fileIn: files,
fileOut: 'public/css/main.min.css',
tempPath: '../tmp',
callback: function(err){
console.log("Compressed CSS, error: " + err);
checkCompleted();
}
});

Perhaps when I'm using supervisor it's stopping and restarting before your callbacks can be called and the temp files deleted?

It basically looks when files are modified and then reboots the server.

Do you perform all the cleanup before the final file is outputted?

@srod

This comment has been minimized.

Show comment Hide comment
@srod

srod Jan 31, 2013

Owner

Can you try with a / in your tempPath ? tempPath: '../tmp/'
Otherwise, here is the order :

  • file creation
  • cleanup temp files
  • callback

I was testing some others possibilities, all seems good.
But, yes it can be a possibility, if your supervisor kills the process before the end of the minification.

Owner

srod commented Jan 31, 2013

Can you try with a / in your tempPath ? tempPath: '../tmp/'
Otherwise, here is the order :

  • file creation
  • cleanup temp files
  • callback

I was testing some others possibilities, all seems good.
But, yes it can be a possibility, if your supervisor kills the process before the end of the minification.

@mattlockyer

This comment has been minimized.

Show comment Hide comment
@mattlockyer

mattlockyer Jan 31, 2013

That didn't work, I still get a bunch of temp files in my main application directory.

I believe it was the aforementioned problem.

That didn't work, I still get a bunch of temp files in my main application directory.

I believe it was the aforementioned problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment