A
A
AntonIgin2017-07-04 08:31:32
Django
AntonIgin, 2017-07-04 08:31:32

Delayed Notifications: How do I check every minute in Django if it's time to execute a script?

The crux of the issue is in the title. There are model objects where the date and time of publication are indicated in the field.
I understand how the condition "if the time has come" should look like - the question is exactly how to make each object periodically check for this condition.
I was just able to figure out celery and perform the first tasks with a manually launched worker. As soon as I wrote the word "periodically", I thought about periodic_tasks, but is this the only option?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Dimonchik, 2017-07-04
@dimonchik2013

Celery - a very correct approach,
but sometimes a regular crown is enough

I
Ivan, 2017-07-04
@ATNC

You can use a very small library to solve your problem.
Literally in 3 lines you can write a working script.
https://github.com/coleifer/huey

G
Gasoid, 2017-07-04
@Gasoid

use huey/celery/rqworker
while huey is very simple

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question