Answer the question
In order to leave comments, you need to log in
How to call a function according to the time specified in the database?
What is the best way to process the task when each user in the database has time to receive some data, each time is different. You need to call the function at the specified time in the database. For now, the solution is to use a separate function that will once in a while look at the time values and form a scheduler. Are there any other solutions?
Answer the question
In order to leave comments, you need to log in
user - program user?
if the user of the program then, because everyone has a different time ... then, IMHO, one task is written - a procedure that will run with a minimum tick (time quantum, for example, every minute or every 5 minutes), read the task (s) from the table for the current "tick" of time and perform them, mark the task as completed, in case of successful completion.
You can of course get confused and create a Job for each user task.
As an option, create a table in which there will be a task ID and time for the task and pull out the last 100 tasks, sorting them by time, store these tasks in some cache and then work with them.
I would advise you to write some kind of service for this
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question