From 23d0c9e994834c87143f97d00a87000577608736 Mon Sep 17 00:00:00 2001 From: Ondra Kosarko Date: Mon, 4 Dec 2023 14:08:42 +0100 Subject: [PATCH] Fix for (some) pdf reports not being send With the default config the `lr.email.burst` is 20. If clarin-dspace needs to send more than `lr.email.burst` mails, some of them get queued. The piwik-report-generator is a short lived process, it does not wait for the queue to be empty and exits. Hence any email in the queue is actually not sent. This fix just changes `lr.email.burst` when calling `make generate_piwik_reports`. System properties have a rather low priority. If you have `lr.email.burst` in `config/modules/*.cfg` or `config/dspace.cfg` this fix will not work. --- dspace-api/src/main/java/org/dspace/core/Email.java | 1 + utilities/project_helpers/scripts/makefile | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/dspace-api/src/main/java/org/dspace/core/Email.java b/dspace-api/src/main/java/org/dspace/core/Email.java index 1df4c570cac5..ee3d2c9bdf34 100644 --- a/dspace-api/src/main/java/org/dspace/core/Email.java +++ b/dspace-api/src/main/java/org/dspace/core/Email.java @@ -701,6 +701,7 @@ private static class BurstDelayQueue extends DelayQueue { public BurstDelayQueue(int burstSize){ super(); this.burstSize = burstSize; + log.info("BurstDelayQueue initiated with burstSize=" + burstSize); } @Override diff --git a/utilities/project_helpers/scripts/makefile b/utilities/project_helpers/scripts/makefile index 91d5b49f5910..45b3f1a53491 100644 --- a/utilities/project_helpers/scripts/makefile +++ b/utilities/project_helpers/scripts/makefile @@ -440,4 +440,4 @@ migrate_databases: ./migrate_db.sh $(UTILITIES_DATABASE_NAME) generate_piwik_reports: - LC_ALL=en_US.UTF-8 $(DSPACE_BIN) piwik-report-generator + LC_ALL=en_US.UTF-8 JAVA_OPTS="-Xmx2048m -Dfile.encoding=UTF-8 -Ddspace.lr.email.burst=32768" $(DSPACE_BIN) piwik-report-generator