1. opensymphony
  2. quartz

Commits

jhouse  committed f6811ff

QUARTZ-641: Invalid run triggers with startTime older than about 248 days

git-svn-id: http://svn.opensymphony.com/svn/quartz/trunk@78369f7d36a-ea1c-0410-88ea-9fd03e4c9665

  • Participants
  • Parent commits 815e204
  • Branches master

Comments (0)

Files changed (1)

File src/java/org/quartz/core/QuartzSchedulerThread.java

View file
  • Ignore whitespace
                         // timeUntilTrigger, we spin here... don't worry
                         // though, this spinning
                         // doesn't even register 0.2% cpu usage on a pentium 4.
-                        int numPauses = (int) (timeUntilTrigger / spinInterval);
+                        long numPauses = (timeUntilTrigger / spinInterval);
                         while (numPauses >= 0 && !signaled) {
 
                             try {
 
                             now = System.currentTimeMillis();
                             timeUntilTrigger = triggerTime - now;
-                            numPauses = (int) (timeUntilTrigger / spinInterval);
+                            numPauses = (timeUntilTrigger / spinInterval);
                         }
                         if (signaled) {
                             try {
                             }
 
                             // it's possible to get 'null' if the trigger was paused,
-                            // blocked, or other similar occurances that prevent it being
+                            // blocked, or other similar occurences that prevent it being
                             // fired at this time...  or if the scheduler was shutdown (halted)
                             if (bndle == null) {
                                 try {
                 long waitTime = now + getRandomizedIdleWaitTime();
                 long timeUntilContinue = waitTime - now;
                 long spinInterval = 10;
-                int numPauses = (int) (timeUntilContinue / spinInterval);
+                long numPauses = (timeUntilContinue / spinInterval);
     
                 while (numPauses > 0 && !signaled) {
     
     
                     now = System.currentTimeMillis();
                     timeUntilContinue = waitTime - now;
-                    numPauses = (int) (timeUntilContinue / spinInterval);
+                    numPauses = (timeUntilContinue / spinInterval);
                 }
             } catch(RuntimeException re) {
                 getLog().error("Runtime error occured in main trigger firing loop.", re);