简体   繁体   English

如何在每天的特定时间执行请求?

[英]How to execute a request at a specific time every day?

Let's assume that I am developing an application that allows me to monitor the psychological state of a person every day.假设我正在开发一个应用程序,它允许我每天监控一个人的心理状态。 When a user completes another survey, the data for the day is saved to the database.当用户完成另一项调查时,当天的数据将保存到数据库中。 But if the user has not completed the survey during the day, the result Day(0, 0, 0) should be sent to the database但是如果用户在白天没有完成调查,结果 Day(0, 0, 0) 应该发送到数据库

The question is How to implement a behavior so that at a certain time (11:59 pm) the application checks whether something is in the database for that day or not?问题是如何实现一种行为,以便在某个时间(晚上 11 点 59 分)应用程序检查当天数据库中是否存在某些内容? What should i use to implement this behavior?我应该用什么来实现这种行为?

Thanks in advance.提前致谢。

You can use Work Manager to do periodic work.您可以使用工作管理器进行定期工作。

check out this approved answer https://stackoverflow.com/a/51330829/7209822查看此批准的答案https://stackoverflow.com/a/51330829/7209822

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM