Use a uniq value also for SHP files

This commit is contained in:
cgonzalez 2021-03-29 17:27:16 +01:00
parent d8a74feeaf
commit 26d9c60a40

View File

@ -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';