Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions app/models/formats/ogr.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ OgrFormat.prototype = {
getFileExtension: function(){ return this._fileExtension; },

getKey: function(options) {
return [this.id,
return this.generateMD5([this.id,
options.dbopts.dbname,
options.dbopts.user,
options.gn,
this.generateMD5(options.filename),
this.generateMD5(options.sql)].concat(options.skipfields).join(':');
options.filename,
options.sql].concat(options.skipfields).join(':'));
},

generateMD5: function (data){
Expand Down Expand Up @@ -219,14 +219,14 @@ OgrFormat.prototype.toOGR_SingleFile = function(options, fmt, callback) {
var layername = options.filename;

var tmpdir = global.settings.tmpDir || '/tmp';
var reqKey = [
var reqKey = this.generateMD5([
fmt,
dbname,
user_id,
gcol,
this.generateMD5(layername),
this.generateMD5(sql)
].concat(skipfields).join(':');
layername,
sql
].concat(skipfields).join(':'));
var outdirpath = tmpdir + '/sqlapi-' + process.pid + '-' + reqKey;
var dumpfile = outdirpath + ':cartodb-query.' + ext;

Expand Down
2 changes: 1 addition & 1 deletion app/models/formats/ogr/shp.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ ShpFormat.prototype.toSHP = function (options, callback) {
var fmtObj = this;
var zip = 'zip'; // FIXME: make configurable
var tmpdir = global.settings.tmpDir || '/tmp';
var reqKey = [ 'shp', dbname, user_id, gcol, this.generateMD5(sql) ].concat(skipfields).join(':');
var reqKey = this.generateMD5([ 'shp', dbname, user_id, gcol, sql ].concat(skipfields).join(':'));
var outdirpath = tmpdir + '/sqlapi-' + process.pid + '-' + reqKey;
var zipfile = outdirpath + '.zip';
var shapefile = outdirpath + '/' + filename + '.shp';
Expand Down