create thread_number and file_path params
This commit is contained in:
@@ -69,12 +69,12 @@ def send_appointment_request(message_queue_name, _contact_list):
|
|||||||
receiver.run()
|
receiver.run()
|
||||||
|
|
||||||
|
|
||||||
def start_send_requests():
|
def start_send_requests(thread_number=5, file_path='~/Desktop/24_04_to_test.xlsx'):
|
||||||
print("start send requests")
|
print("start send requests")
|
||||||
contacts_file_path = '~/Desktop/contact_list_merged.xlsx'
|
contacts_file_path = file_path
|
||||||
_contact_list = read_contacts(contacts_file_path)
|
_contact_list = read_contacts(contacts_file_path)
|
||||||
_contact_list_to_book = filter_contacts(_contact_list)
|
_contact_list_to_book = filter_contacts(_contact_list)
|
||||||
_segment_number = 20
|
_segment_number = thread_number
|
||||||
logger.info("{} contacts to book".format(len(_contact_list_to_book)))
|
logger.info("{} contacts to book".format(len(_contact_list_to_book)))
|
||||||
last_thread = None
|
last_thread = None
|
||||||
for i in range(0, _segment_number):
|
for i in range(0, _segment_number):
|
||||||
@@ -88,4 +88,4 @@ def start_send_requests():
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
start_send_requests()
|
start_send_requests(thread_number=5, file_path='~/Desktop/24_04_to_test.xlsx')
|
||||||
|
|||||||
Reference in New Issue
Block a user