[quarkus-quartz] `cron` expression of `@Scheduled` is not updated via ENV (overwriting application.properties)
See original GitHub issueDescribe the bug
Given
@Scheduled(identity = "aJob", cron = "{a.job.schedule.cron}")
in codea.job.schedule.cron=0 0 1 * * ? *
in application.properties andA_JOB_SCHEDULE_CRON=0 0 1 * * ? 2100
in ENV
if the application has been started prior without the ENV part, restarting the application with ENV doesn’t update the field cron_expression
in the table qrtz_cron_triggers
.
if the application has not been started prior without the ENV part, starting it the first time with ENV leads to cron_expression
being filled with the cron expression from ENV, not from application.properties (as expected).
Expected behavior
Field cron_expression
in the table qrtz_cron_triggers
is updated.
Alternatively, this behaviour is documented on the https://quarkus.io/guides/quartz and there is a way to overwrite existing cron expressions using ENV.
Actual behavior
Field cron_expression
in the table qrtz_cron_triggers
is not updated.
How to Reproduce?
No response
Output of uname -a
or ver
Microsoft Windows [Version 10.0.18363.1766]
Output of java -version
11.0.10
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.2.1.Final
Build tool (ie. output of mvnw --version
or gradlew --version
)
Apache Maven 3.8.1
Additional information
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (3 by maintainers)
I’ve built the partial
999-SNAPSHOT
withmvn install -DskipTests -am -pl :quarkus-quartz
, replacedquarkus-quartz
version in the guided application and it worked like a charm:application.properties
worked and updated the cron definition in the DBapplication.properties
and additional ENV took proper precedence and updated the cron definition in the DB according to ENVThanks for the quick fix @machi1990 !
@machi1990 - thanks for the quick reply, i’ll try it out tomorrow.