I use the application presented on some website to collect some data from the website, for example, 30 seconds. The returned response is then written to the database.
I use modular import query requests and write codes to throw an Exception. The codes for the main function are as follows:
def get_response(self):
try:
response = requests.get(self.request_url)
if response.status_code == 200:
return response.json()
except Exception as e:
msg = "Exception is:\n %s \n" % e
print msg
The above function works very well for the first few hours. The function may also recover due to some exceptions, such as: ("Connection aborted.", BadStatusLine ("'' ',))
or (' Connection aborted. ', Error (10053,' ')) It throws an exception (by Null database entries in the database) and continues to receive a response of the next period.
However, the function stops working with error 10054.
Exception is:
('Connection aborted.', error(10054, ''))
, , Null , 10054.
, - , .
, .
, -.
stackoverflow : Errno 10054 .
, .
? ( )
?
(, funtion, .)
.