This is an automated email from the ASF dual-hosted git repository.
kwin pushed a commit to branch master
in repository
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-commons-scheduler.git
The following commit(s) were added to refs/heads/master by this push:
new f43755d SLING-12702 Emit warning when scheduling fails for some reason
f43755d is described below
commit f43755d9a3acb331472f61ba8c2f512bb8f700cd
Author: Konrad Windszus <[email protected]>
AuthorDate: Fri Mar 7 11:00:14 2025 +0100
SLING-12702 Emit warning when scheduling fails for some reason
Emit class name of job which cannot be scheduled
---
.../org/apache/sling/commons/scheduler/impl/QuartzScheduler.java | 6 ++----
.../org/apache/sling/commons/scheduler/impl/WhiteboardHandler.java | 2 +-
2 files changed, 3 insertions(+), 5 deletions(-)
diff --git
a/src/main/java/org/apache/sling/commons/scheduler/impl/QuartzScheduler.java
b/src/main/java/org/apache/sling/commons/scheduler/impl/QuartzScheduler.java
index 9703a95..9274634 100644
--- a/src/main/java/org/apache/sling/commons/scheduler/impl/QuartzScheduler.java
+++ b/src/main/java/org/apache/sling/commons/scheduler/impl/QuartzScheduler.java
@@ -525,10 +525,8 @@ public class QuartzScheduler implements BundleListener {
try {
this.scheduleJob(bundleId, serviceId, job, options);
return true;
- } catch (final IllegalArgumentException iae) {
- // ignore this and return false
- return false;
- } catch (final SchedulerException se) {
+ } catch (final IllegalArgumentException|SchedulerException e) {
+ logger.warn("Exception during scheduling of job " +
job.getClass().getName(), e);
// ignore this and return false
return false;
}
diff --git
a/src/main/java/org/apache/sling/commons/scheduler/impl/WhiteboardHandler.java
b/src/main/java/org/apache/sling/commons/scheduler/impl/WhiteboardHandler.java
index 52c6948..0fde4c0 100644
---
a/src/main/java/org/apache/sling/commons/scheduler/impl/WhiteboardHandler.java
+++
b/src/main/java/org/apache/sling/commons/scheduler/impl/WhiteboardHandler.java
@@ -271,7 +271,7 @@ public class WhiteboardHandler {
if ( this.scheduler.schedule(bundleId, serviceId, job, options) ) {
this.idToNameMap.put(serviceId, name);
} else {
- logger.error("Scheduling service {} failed.", ref);
+ logger.error("Scheduling Runnable service {} failed.",
job.getClass().getName());
}
}
}