Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var ExportJobImage = function(model, queue) {
var task = new Task();
task.on('start', function() {
this.emit('work');
});
task.on('work', function() {
Step(
function() {
path.exists(path.join(settings.export_dir, model.get('filename')), this);
},
function(exists) {
if (exists) {
var filename = model.get('filename');
var extension = path.extname(filename);
var date = new Date();
var hash = require('crypto').createHash('md5')
.update(date.getTime()).digest('hex').substring(0,6);
model.set({