如何在Spring调度程序中应用动态条件?

huangapple 未分类评论42阅读模式
英文:

How to apply dynamic Condition in scheduler in spring?

问题

我有一个安卓应用程序,可以在数据库中保存的特定日期和时间提醒用户进行工作。

我想要创建一个功能,在用户的工作时间后的30分钟内更改用户的工作状态,为此我必须每天、每秒钟都在数据库中检查现在是否有任何工作?

我可以在Spring Boot中使用调度程序,但如何将数据库中存储的时间应用于运行此调度任务?

可能没有工作,那么就会产生不必要的调用。

如何应用条件,使调度程序只在工作准备就绪时才会被调用?

英文:

I have an android app which reminds user to their specific Work at any Date and time that saved on database.

I want to create functionality that changes user work status after 30 min of their work time and for this I have to check in the Database every day and every second that Is there any work now?

I can use scheduler in spring boot, but how can I apply database stored time to run this schedule task?

There may possibly of no work then, there will be unnnecessary calls.

How can I apply condition that Scheduler must be call only when Work is ready?

huangapple
  • 本文由 发表于 2020年4月4日 01:19:35
  • 转载请务必保留本文链接:https://java.coder-hub.com/61017161.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定