From d65bec58cdfa7ac1ff1e8f1c42ce912d7050c307 Mon Sep 17 00:00:00 2001 From: fabrizzio-dotCMS Date: Tue, 8 Oct 2024 16:16:37 -0600 Subject: [PATCH] #29480 --- .../jobs/business/processor/impl/LargeFileReader.java | 2 +- .../com/dotcms/rest/api/v1/job/JobQueueHelper.java | 2 ++ .../com/dotcms/rest/api/v1/job/JobQueueResource.java | 1 + .../mapper/badrequest/MultiExceptionMapper.java | 10 ---------- 4 files changed, 4 insertions(+), 11 deletions(-) delete mode 100644 dotCMS/src/main/java/com/dotcms/rest/exception/mapper/badrequest/MultiExceptionMapper.java diff --git a/dotCMS/src/main/java/com/dotcms/jobs/business/processor/impl/LargeFileReader.java b/dotCMS/src/main/java/com/dotcms/jobs/business/processor/impl/LargeFileReader.java index 85dd71495321..486431dcee58 100644 --- a/dotCMS/src/main/java/com/dotcms/jobs/business/processor/impl/LargeFileReader.java +++ b/dotCMS/src/main/java/com/dotcms/jobs/business/processor/impl/LargeFileReader.java @@ -85,7 +85,7 @@ private void doReadLargeFile(DotTempFile dotTempFile, int nLines, final Job job) Logger.info(this.getClass(), line); delay(); } - final float progressPercentage = ((float) readCount / totalCount) * 100; + final float progressPercentage = ((float) readCount / totalCount); progressTracker.ifPresent(tracker -> tracker.updateProgress(progressPercentage)); } diff --git a/dotCMS/src/main/java/com/dotcms/rest/api/v1/job/JobQueueHelper.java b/dotCMS/src/main/java/com/dotcms/rest/api/v1/job/JobQueueHelper.java index 2e38020bbfa3..c815414c2e04 100644 --- a/dotCMS/src/main/java/com/dotcms/rest/api/v1/job/JobQueueHelper.java +++ b/dotCMS/src/main/java/com/dotcms/rest/api/v1/job/JobQueueHelper.java @@ -235,6 +235,8 @@ private void handleUploadIfPresent(final JobParams form, Map par } catch (Exception e) { Logger.error(this.getClass(), "Error saving temp file", e); } + } else { + Logger.info(this.getClass(), "No file was uploaded."); } } diff --git a/dotCMS/src/main/java/com/dotcms/rest/api/v1/job/JobQueueResource.java b/dotCMS/src/main/java/com/dotcms/rest/api/v1/job/JobQueueResource.java index 36c6ac0069b4..7c94a493d599 100644 --- a/dotCMS/src/main/java/com/dotcms/rest/api/v1/job/JobQueueResource.java +++ b/dotCMS/src/main/java/com/dotcms/rest/api/v1/job/JobQueueResource.java @@ -197,6 +197,7 @@ public EventOutput monitorJob(@Context HttpServletRequest request, @PathParam("j .data(String.class, "404") .build(); eventOutput.write(event); + eventOutput.close(); } catch (IOException e) { Logger.error(this, "Error closing SSE connection", e); } diff --git a/dotCMS/src/main/java/com/dotcms/rest/exception/mapper/badrequest/MultiExceptionMapper.java b/dotCMS/src/main/java/com/dotcms/rest/exception/mapper/badrequest/MultiExceptionMapper.java deleted file mode 100644 index da2c32269f68..000000000000 --- a/dotCMS/src/main/java/com/dotcms/rest/exception/mapper/badrequest/MultiExceptionMapper.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.dotcms.rest.exception.mapper.badrequest; - -import com.dotcms.rest.exception.mapper.DotBadRequestExceptionMapper; -import javax.ws.rs.ext.Provider; - -@Provider -public class IllegalStateExceptionMapper - extends DotBadRequestExceptionMapper { - -}