Replies: 1 comment
-
I think the check just doesn't work. Spring injects a collection with all beans of a given type in context, so if there are none, then an empty list will be injected. Anyway, in my opinion, the check is actually bad. I would prefer it to skip initializing the scheduler instead. The current approach would just kill the app on startup because no tasks were configured. This may be the case when you're just starting development but have already added the db-scheduler library. An example could be common configuration used across multiple services. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I was exploring db-scheduler in general for a spring-boot app and I noticed the following check:
this.configuredTasks = Objects.requireNonNull(configuredTasks, "At least one Task must be configured");
however, I think this doesn't do what was intended - when I started my app up without any Tasks configured (I dove head first in skimming the docs), the list was just empty instead of null.
The message "At least one Task must be configured" led me to think this should probably throw an exception when the list is empty instead of if the list is null
was hesitant to file an issue because I wasn't sure if there is a use-case for running with 0 configured tasks or maybe there is something else I am not aware of
Beta Was this translation helpful? Give feedback.
All reactions