hi
i have a function that send emails
def say_hi(receiver):
print(“hi”+receiver )
i want it to execute when exception happen put it in queue and schedule it to run in next day after 24 hours .
how can i accomplish this in frappe .
it will be something like :
import copy
def say_hi(receivers)
rest_of_receivers = copy.copy(receivers)
for receiver in receivers:
try:
print("hi"+receiver )
rest_of_receivers.remove(receiver)
except:
enqueue(say_hi(rest_of_receivers),24hours,"job name say hi after 24 hours date" )
i don’t think this is what im looking for , it make you called a function from a hook based on time that repeats on a specific time …
what i want is to put it by hand to queue to be executed till the condition meet … then i don’t need it any more !
if you try to create free sendgrid email … it will allow you only 100 email a day …
what im trying to do is trick that in erpnext
queue will be executed … if this exception occers limited emails … i want it to queue the rest of emails and try again 24 later … so if i have 240 emails
first day 100
second day 100
third day 40 .
and i can see jobs happing in bench doctor and notice whatis going on instaid of useing sleep(24 hours)