Merge pull request #681 from CartoDB/feature/ch139802/phl-inconsistent-errors-when-downloading

[ch139802] Avoid concurrent requests from getting stuck when exporting file formats handled by OGR - v2
remotes/origin/dependabot/npm_and_yarn/y18n-4.0.1
Shylpx 4 years ago committed by GitHub
commit 248c98bc83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,5 +1,6 @@
'use strict';
var uuid = require('uuid');
var step = require('step');
var fs = require('fs');
var spawn = require('child_process').spawn;
@ -37,7 +38,7 @@ ShpFormat.prototype.toSHP = function (options, callback) {
var zip = global.settings.zipCommand || 'zip';
var zipOptions = '-qrj';
var tmpdir = global.settings.tmpDir || '/tmp';
var reqKey = this.limitPathname(['shp', dbname, userId, gcol, this.generateMD5(sql)].concat(skipfields).join(':'));
var reqKey = this.limitPathname(['shp', dbname, userId, gcol, this.generateMD5(sql), uuid.v4()].concat(skipfields).join(':'));
var outdirpath = tmpdir + '/sqlapi-' + process.pid + '-' + reqKey;
var zipfile = outdirpath + '.zip';
var shapefile = outdirpath + '/' + filename + '.shp';

Loading…
Cancel
Save