You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "prasanthrao (via GitHub)" <gi...@apache.org> on 2023/11/20 08:03:08 UTC
[PR] CAMEL-20115: Support for Start Date and End Date in camel-quartz [camel]
prasanthrao opened a new pull request, #12089:
URL: https://github.com/apache/camel/pull/12089
# Description
Fix for [CAMEL-20115](https://issues.apache.org/jira/browse/CAMEL-20115) Support for Start Date and End Date in camel-quartz
# Target
- [ ] I checked that the commit is targeting the correct branch (note that Camel 3 uses `camel-3.x`, whereas Camel 4 uses the `main` branch)
# Tracking
- [ ] If this is a large change, bug fix, or code improvement, I checked there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it).
<!--
# *Note*: trivial changes like, typos, minor documentation fixes and other small items do not require a JIRA issue. In this case your pull request should address just this issue, without pulling in other changes.
-->
# Apache Camel coding standards and style
- [ ] I checked that each commit in the pull request has a meaningful subject line and body.
<!--
If you're unsure, you can format the pull request title like `[CAMEL-XXX] Fixes bug in camel-file component`, where you replace `CAMEL-XXX` with the appropriate JIRA issue.
-->
- [ ] I have run `mvn clean install -DskipTests` locally and I have committed all auto-generated changes
<!--
You can run the aforementioned command in your module so that the build auto-formats your code. This will also be verified as part of the checks and your PR may be rejected if if there are uncommited changes after running `mvn clean install -DskipTests`.
You can learn more about the contribution guidelines at https://github.com/apache/camel/blob/main/CONTRIBUTING.md
-->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-20115: Support for Start Date and End Date in camel-quartz [camel]
Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus closed pull request #12089: CAMEL-20115: Support for Start Date and End Date in camel-quartz
URL: https://github.com/apache/camel/pull/12089
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-20115: Support for Start Date and End Date in camel-quartz [camel]
Posted by "oscerd (via GitHub)" <gi...@apache.org>.
oscerd commented on PR #12089:
URL: https://github.com/apache/camel/pull/12089#issuecomment-1818824806
Shouldn't this need to go on main first?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-20115: Support for Start Date and End Date in camel-quartz [camel]
Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on PR #12089:
URL: https://github.com/apache/camel/pull/12089#issuecomment-1819855743
3.1.4 is EOL and we should only do this change in newer releases
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-20115: Support for Start Date and End Date in camel-quartz [camel]
Posted by "prasanthrao (via GitHub)" <gi...@apache.org>.
prasanthrao commented on code in PR #12089:
URL: https://github.com/apache/camel/pull/12089#discussion_r1398944443
##########
components/camel-quartz/src/main/java/org/apache/camel/component/quartz/CamelJob.java:
##########
@@ -94,6 +101,18 @@ public void execute(JobExecutionContext context) throws JobExecutionException {
}
}
+ private boolean hasTriggerExpired(JobExecutionContext context) {
+ Date fireTime = context.getFireTime();
+ if (context.getTrigger().getStartTime() != null && fireTime.before(context.getTrigger().getStartTime())) {
+ // Trigger invalid as Fire Time is before Start Time
+ return true;
+ } else if (context.getTrigger().getEndTime() != null && fireTime.after(context.getTrigger().getEndTime())) {
Review Comment:
Indeed I missed the case, and corrected it in the new commit.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-20115: Support for Start Date and End Date in camel-quartz [camel]
Posted by "davsclaus (via GitHub)" <gi...@apache.org>.
davsclaus commented on code in PR #12089:
URL: https://github.com/apache/camel/pull/12089#discussion_r1398810047
##########
components/camel-quartz/src/main/java/org/apache/camel/component/quartz/CamelJob.java:
##########
@@ -94,6 +101,18 @@ public void execute(JobExecutionContext context) throws JobExecutionException {
}
}
+ private boolean hasTriggerExpired(JobExecutionContext context) {
+ Date fireTime = context.getFireTime();
+ if (context.getTrigger().getStartTime() != null && fireTime.before(context.getTrigger().getStartTime())) {
+ // Trigger invalid as Fire Time is before Start Time
+ return true;
+ } else if (context.getTrigger().getEndTime() != null && fireTime.after(context.getTrigger().getEndTime())) {
Review Comment:
I think this should not be an else if, as you can have set BOTH start and end time, and then you need to check for both of them.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAMEL-20115: Support for Start Date and End Date in camel-quartz [camel]
Posted by "prasanthrao (via GitHub)" <gi...@apache.org>.
prasanthrao commented on PR #12089:
URL: https://github.com/apache/camel/pull/12089#issuecomment-1818826897
> Shouldn't this need to go on main first?
Should I also create a PR for the main branch?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org