correction on uploading timestamp while sending appointment request
This commit is contained in:
+5
-24
@@ -93,14 +93,14 @@ class Sender:
|
||||
contact.ua = js_data.ua
|
||||
contact.current_ip = get_address_ip(proxy_to_use=self.proxy_to_use)
|
||||
_appointment_url = _redirect_url
|
||||
self.publish_message_to_queue(contact, status=PublishType.SUCCESS, url=_appointment_url,
|
||||
store_type=selected_store, model=model)
|
||||
# self.publish_message_to_queue(contact, status=PublishType.SUCCESS, url=_appointment_url,
|
||||
# store_type=selected_store, model=model)
|
||||
self.cookie.load(_cookies_to_set)
|
||||
new_cookies = {k: v.value for k, v in self.cookie.items()}
|
||||
new_coolies_str = ""
|
||||
for key in new_cookies:
|
||||
new_coolies_str = new_coolies_str + key + "=" + new_cookies[key] + ";"
|
||||
self.logger.info("will publish to queue {}".format(new_coolies_str))
|
||||
self.logger.info("will publish to queue")
|
||||
# upload the cookie to queue
|
||||
self.received_dict['cookiesStr'] = new_coolies_str
|
||||
# Add timestampInS field with current timestamp in seconds as a list
|
||||
@@ -115,6 +115,8 @@ class Sender:
|
||||
else:
|
||||
# Create new list with the timestamp
|
||||
self.received_dict['timestampInS'] = [current_timestamp]
|
||||
self.publish_message_to_queue(contact, status=PublishType.SUCCESS, url=_appointment_url,
|
||||
store_type=selected_store, model=model)
|
||||
self.logger.info("body in json:{}".format(json.dumps(self.received_dict)))
|
||||
if self.cookiesPublisher is not None:
|
||||
self.cookiesPublisher.publish_body(json.dumps(self.received_dict))
|
||||
@@ -211,27 +213,6 @@ class Sender:
|
||||
self.logger.info(response.text)
|
||||
self.apply_redirect(response=response, old_headers=headers, contact=contact, js_data=js_data,
|
||||
selected_store=_selected_store, model=model)
|
||||
# self.logger.info("{}:{}".format(contact.mail, response.url))
|
||||
# contact.ua = js_data.ua
|
||||
# contact.current_ip = get_address_ip(proxy_to_use=proxy_to_use)
|
||||
# _appointment_url = response.url
|
||||
# self.publish_message_to_queue(contact, status=PublishType.SUCCESS, url=_appointment_url,
|
||||
# store_type=_selected_store)
|
||||
# cookies_to_set = response.headers['set-cookie']
|
||||
# self.cookie.load(cookies_to_set)
|
||||
# new_cookies = {k: v.value for k, v in self.cookie.items()}
|
||||
# new_coolies_str = ""
|
||||
# for key in new_cookies:
|
||||
# new_coolies_str = new_coolies_str + key + "=" + new_cookies[key] + ";"
|
||||
# self.logger.info("will publish to queue {}".format(new_coolies_str))
|
||||
# # upload the cookie to queue
|
||||
# self.received_dict['cookiesStr'] = new_coolies_str
|
||||
# self.logger.info("body in json:{}".format(json.dumps(self.received_dict)))
|
||||
# if self.cookiesPublisher is not None:
|
||||
# self.cookiesPublisher.publish_body(json.dumps(self.received_dict))
|
||||
# # self.cookie_str = new_coolies_str
|
||||
# self.logger.info("successful request, mail:{}".format(contact.mail))
|
||||
# self.send_jsdata_request(js_data, _appointment_url, new_coolies_str)
|
||||
return RequestResult.SUCCESS
|
||||
else:
|
||||
print(response.text)
|
||||
|
||||
Reference in New Issue
Block a user