handle not valid json exception
This commit is contained in:
@@ -188,7 +188,8 @@ class LinkValidatorWithProvidedList(threading.Thread):
|
||||
self.cookiesPublisher.publish_body(json.dumps(_received_dict))
|
||||
ch.basic_ack(delivery_tag=method.delivery_tag)
|
||||
self.channel.stop_consuming()
|
||||
except:
|
||||
except Exception as error:
|
||||
print(error)
|
||||
print("not json format will ack")
|
||||
ch.basic_ack(delivery_tag=method.delivery_tag)
|
||||
|
||||
@@ -217,7 +218,7 @@ def validate_all_links(_contact_serial_list):
|
||||
link_to_validated = []
|
||||
for _link in all_link_list:
|
||||
# print("serial is "+_link.serial)
|
||||
print("email is "+_link.email)
|
||||
print("email is " + _link.email)
|
||||
if _link.serial == "requests":
|
||||
link_to_validated.append(_link)
|
||||
# get the first 50 links
|
||||
@@ -227,8 +228,8 @@ def validate_all_links(_contact_serial_list):
|
||||
# default_segment_number = 20
|
||||
_first_25_percent_links = link_to_validated[0:(int(len(all_link_list) / divided))]
|
||||
_first_25_percent_links = all_link_list
|
||||
# _queue_name = MORNING_DATA_CACHE
|
||||
_queue_name = MORNING_DATA_CACHE_BAK
|
||||
_queue_name = MORNING_DATA_CACHE
|
||||
# _queue_name = MORNING_DATA_CACHE_BAK
|
||||
# if len(all_link_list) > divided * default_segment_number:
|
||||
# _segment_number = default_segment_number
|
||||
# else:
|
||||
@@ -238,7 +239,7 @@ def validate_all_links(_contact_serial_list):
|
||||
# else:
|
||||
# _segment_number = 1
|
||||
_thread_list = []
|
||||
if len(_first_25_percent_links) >=10:
|
||||
if len(_first_25_percent_links) >= 10:
|
||||
_segment_number = 10
|
||||
else:
|
||||
_segment_number = 1
|
||||
|
||||
Reference in New Issue
Block a user