You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
9 lines
320 B
9 lines
320 B
import datetime
|
|
from celery.task import periodic_task
|
|
from service.models import MailBox
|
|
|
|
|
|
@periodic_task(run_every=datetime.timedelta(minutes=1))
|
|
def mailbox_send():
|
|
for box in MailBox.objects.filter(queue_date__lte=datetime.datetime.now(), status__in=['Q', 'W']).order_by('-queue_date'):
|
|
box.send_letter()
|
|
|