@ApplicationScoped
and @Scheduled
with @UnlessBuildProperty
#39994
-
I have a service class like so :
The intention is that the service class should not be instantiated at all in case the build property However with the Only when I comment out the above annotation does it work. What am I doing wrong ? And how should I fix this ? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Beta Was this translation helpful? Give feedback.
-
For this you need to specify the
Are you sure the expression you are using is evaluating correctly? I.e. |
Beta Was this translation helpful? Give feedback.
For this you need to specify the
enableIfMissing
property on the annotation, see this.Are you sure the expression you are using is evaluating correctly? I.e.
@Scheduled(every = "${check.interval:1M}")
For an execution once a min, I think you could use something like
@Scheduled(every="1m")
.