fixed FetchPDF

This commit is contained in:
Francesco Mangiacrapa 2024-04-22 10:37:14 +02:00
parent b35cbb7fd8
commit 30a02fe94f
1 changed files with 3 additions and 5 deletions

View File

@ -126,16 +126,14 @@ public class GeoportalExporter {
if (userAgentName != null) {
LOG.info("Serving request as User-Agent {}", userAgentName);
final String pollingCode = ucdID + "_" + projectID + "_" + System.currentTimeMillis();
final FetchPDF fetchPDF = new FetchPDF(null, pollingCode, 0);
map.put(pollingCode, fetchPDF);
try {
Thread t = new Thread() {
@Override
public void run() {
LOG.info("exportAsPDF called in thread...");
FileReference pdfRef = null;
FetchPDF fetchPDF = new FetchPDF(pdfRef, pollingCode, 0);
map.put(pollingCode, fetchPDF);
pdfRef = exportAsPDF(req, ucdID, projectID, null, context, user);
FileReference pdfRef = exportAsPDF(req, ucdID, projectID, null, context, user);
LOG.info("exportAsPDF setFileRef in thread for code: " + pollingCode);
fetchPDF.setFileRef(pdfRef);
map.put(pollingCode, fetchPDF);