Answer the question
In order to leave comments, you need to log in
How to implement a notification system?
Hello.
The Task model has a notification_time field. The user puts the date when to "notify" him.
How to trigger an event when the current time is equal to notification_time?
In fact, it is somewhat reminiscent of an alarm clock)
So far I see this option:
Run celery + redis, and poll all Tasks once a minute, and take those with notification_time = current time.
I think there are more rational solutions, so as not to interrogate all tasks.
Thank you in advance
Answer the question
In order to leave comments, you need to log in
And why can't you immediately retrieve Task from the database where notification_time <= current time and which have not been notified yet?
That is, you need one more field - notification status (0 - not notified, 1 - notified).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question