-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jobs not getting fired at correct intervals defined in the triggers #16
Comments
Hmm... this one may be a bit tough to track down. Would you mind posting your setup so that I can have some additional context? (Quartz config, scheduler, job, and trigger initialization, etc.) |
Hi jlinn My demo program + quartz.properties Please do look into this. we Kind of deferred the use of quartz-redis-jobstore as we could not figure out a solution to this. We would want to integrate the use of quartz-redis-jobstore very soon. |
I modified your job code slightly as follows (mainly so I wouldn't have to do math): @PersistJobDataAfterExecution
@DisallowConcurrentExecution
public class WorkingRefreshJob implements Job {
// parameter names specific to this job
public static final String LOGIN_ID = "loginID";
private static final String EXECUTION_TIME = "exTime";
public WorkingRefreshJob() {
}
public void execute(JobExecutionContext context) throws JobExecutionException {
// Grab and print passed parameters
JobDataMap data = context.getJobDetail().getJobDataMap();
String loginID = data.getString(LOGIN_ID);
String previousTime = (String) data.get(EXECUTION_TIME);
final Date executionTime = new Date();
String message = "RefreshJob: execute called " + executionTime +" : for " + loginID;
data.put(EXECUTION_TIME, String.valueOf(executionTime.getTime()));
if (previousTime != null) {
message += " last executed " + (executionTime.getTime() - Long.valueOf(previousTime)) + "ms ago";
}
System.out.println(message);
}
} I then ran the demo locally and got the following output:
As far as I can tell, the jobs are being executed at the proper times. Are you currently using the latest version of the job store (1.1.7)? If not, please update to the latest version. There have been a few bug fixes released since this issue was created. |
Hi Jlinn But i still see the same behavior...incorrect intervals. (see demo program output below) Let me know if you need any other info to debug this. |
HI
I have 2 jobs with separate triggers,
trigger : group1.triggerA For Job key refreshgroup1.refreshjobA will run at: Tue Oct 18 15:23:12 IST 2016 and repeat: 10 times, every 10 seconds
trigger : group2.triggerB For Job key refreshgroup1.refreshjobB will run at: Tue Oct 18 15:23:14 IST 2016 and repeat: 10 times, every 7 seconds
But in the output i see that Job A doesnot repeat after 10 sec, Sometime the interval is 20 sec, sometimes it is 14 sec
Same problem for Job B. the interval is not 7 sec as it is configured to be. What am i missing here?
Thanks for your help.
------- Starting Scheduler ----------------
------- Started Scheduler -----------------
------- Waiting 90 seconds... -------------
RefreshJob: execute called Tue Oct 18 15:23:19 IST 2016 : for A
RefreshJob: execute called Tue Oct 18 15:23:26 IST 2016 : for B
RefreshJob: execute called Tue Oct 18 15:23:32 IST 2016 : for B
RefreshJob: execute called Tue Oct 18 15:23:39 IST 2016 : for A
RefreshJob: execute called Tue Oct 18 15:23:45 IST 2016 : for B
RefreshJob: execute called Tue Oct 18 15:23:52 IST 2016 : for A
RefreshJob: execute called Tue Oct 18 15:23:59 IST 2016 : for B
RefreshJob: execute called Tue Oct 18 15:24:06 IST 2016 : for A
RefreshJob: execute called Tue Oct 18 15:24:14 IST 2016 : for B
RefreshJob: execute called Tue Oct 18 15:24:21 IST 2016 : for B
RefreshJob: execute called Tue Oct 18 15:24:28 IST 2016 : for A
RefreshJob: execute called Tue Oct 18 15:24:35 IST 2016 : for B
RefreshJob: execute called Tue Oct 18 15:24:42 IST 2016 : for A
The text was updated successfully, but these errors were encountered: