I'm currently testing scheduler for this kind of applications, but my 
"homemade" task queues are working fine....

mails = db(s.dat_start<NOW).select(limitby=(0,30))
for a in mails:
        logger.debug('sent mail %s to %s (%s)' % (a.id, a.ntf_to, 
a.ntf_subject))
        message = (a.ntf_text, a.ntf_html)
        transmission = mail
        rslt = transmission.send(
            to=a.ntf_to,
            subject=a.ntf_subject,
            message=message,
            cc=a.ntf_cc,
            bcc=a.ntf_bcc,
            hdrs=sj.loads(a.ntf_headers)
            )
        if transmission.error:
            logging.error('mail sending error %s', transmission.error)
            payload = a.as_dict()
            b.insert(
            ntfb_to=a.ntf_to,
            ntfb_payload=jdumps(payload),
            ntfb_error=str(transmission.error),
            )
        a.delete_record()
        db.commit()

Reply via email to