From e0b1b2a4f4a02ac44e1f6fc267eaf3ba99647f93 Mon Sep 17 00:00:00 2001 From: PAN Lei Date: Sat, 6 Dec 2025 11:06:42 +0100 Subject: [PATCH] correction on uploading timestamp while sending appointment request --- workers/sender.py | 29 +++++------------------------ 1 file changed, 5 insertions(+), 24 deletions(-) diff --git a/workers/sender.py b/workers/sender.py index 5c7223e..69bdddb 100644 --- a/workers/sender.py +++ b/workers/sender.py @@ -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)