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