stop consuming if all item finished
This commit is contained in:
@@ -153,6 +153,7 @@ class ResultLinkChecker(threading.Thread):
|
||||
print("empty list, no need to ack")
|
||||
time.sleep(60)
|
||||
ch.basic_reject(delivery_tag=method.delivery_tag, requeue=True)
|
||||
self.channel.stop_consuming()
|
||||
|
||||
|
||||
def start_check_links(_queue_name, link_list, logger):
|
||||
@@ -175,8 +176,8 @@ def check_all_links(_segment_number=2):
|
||||
if _item.url_validated is not None and _item.url_validated is True:
|
||||
_link_list.append(_item.url)
|
||||
print(_link_list)
|
||||
# _link_list_filted = _link_list[4000:-1]
|
||||
_link_list_filted = _link_list[-4:-1]
|
||||
_link_list_filted = _link_list
|
||||
# _link_list_filted = _link_list[-4:-1]
|
||||
thread_list = []
|
||||
for i in range(0, _segment_number):
|
||||
logger.info("segment is {}".format(i))
|
||||
@@ -192,4 +193,4 @@ def check_all_links(_segment_number=2):
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
check_all_links(_segment_number=2)
|
||||
check_all_links(_segment_number=30)
|
||||
|
||||
Reference in New Issue
Block a user