activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rafael Alfaro <rafael.alf...@gmail.com>
Subject CronParser bug on getNextScheduledTime to handle the once per minute case "* * * * *"
Date Sat, 22 Jun 2013 03:31:11 GMT
Hello,

I created the following report:
https://issues.apache.org/jira/browse/AMQ-4591

It seems that the getNextScheduledTime method is not returning at the top
of the next minute when the CronEntry is "* * * * *"

The precision must have to be in minutes, the following patch fix the issue:

Index: activemq-client/src/main/java/
org/apache/activemq/broker/scheduler/CronParser.java
===================================================================
---
activemq-client/src/main/java/org/apache/activemq/broker/scheduler/CronParser.java
(revision 1494862)
+++
activemq-client/src/main/java/org/apache/activemq/broker/scheduler/CronParser.java
(working copy)
@@ -44,7 +44,7 @@
         // starting the next event at the top of the minute.
         if (cronEntry.equals("* * * * *")) {
             result = currentTime + 60 * 1000;
-            result = result / 1000 * 1000;
+            result = result / 60000 * 60000;
             return result;
         }

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message