dont ack the message when empty list
This commit is contained in:
@@ -94,6 +94,7 @@ class Receiver(threading.Thread):
|
||||
if len(self.contact_list) > 0:
|
||||
captchaResultGetter = CaptchaResultGetter()
|
||||
print("contact number is {}".format(len(self.contact_list)))
|
||||
self.contact_list = filter_contacts(self.contact_list)
|
||||
for con in self.contact_list:
|
||||
# if not is_already_sent(con):
|
||||
print(con.mail)
|
||||
@@ -109,9 +110,12 @@ class Receiver(threading.Thread):
|
||||
self.valid_csrf = None
|
||||
# else:
|
||||
# print(con.mail + "--> skip")
|
||||
time.sleep(random.randint(1, 2))
|
||||
ch.basic_ack(delivery_tag=method.delivery_tag)
|
||||
else:
|
||||
print("empty list")
|
||||
time.sleep(120)
|
||||
ch.basic_reject(delivery_tag=method.delivery_tag, requeue=True)
|
||||
|
||||
def run(self):
|
||||
print(threading.currentThread().name + " starts")
|
||||
|
||||
Reference in New Issue
Block a user