-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Quotecast API freezes after exactly 1 hour since August 30, 2022 #90
Comments
@Chavithra Can you please have a look into this, since it seems a serious stopper. |
AnalysisWhile analysing the source code of the Quotecast API, in particular fetch_data.py, it appears that the requests do not have a timeout specified:
This might cause the freeze of the API after 1 hour in case a timeout would occur. ChangeAdd the response = session.send(request=prepped, timeout=14) Results
except TimeoutError:
logging.warning("DeGiro Quotecast API session did timeout. Reconnecting...")
# Reconnect and subscribe tickers:
quotecast_api.connect()
quotecast_api.subscribe(request=request) Put these 2 together and finally after an hour a reconnect can be done and real-time data resumes: ✅
Discussion
|
Background
We have run our script successfully on a daily basis for the past months.
It uses the Quotecast API to fetch the latest price data of a ticker every 1 second, during the 6.5 market hours of a Ney York trading day.
Issue
However, since August 30, 2022 we don't get any price updates anymore after 1 hour of the start of the Quotecast API.
The issue occurred on version 2.0.16 of
degiro-connector
that we still use. But I've tested that it also occurs on the latest 2.0.21.What I have tried:
connect()
on theQuotecastAPI
after 40 minutes, to somehow refresh or reset a timer. But no success; 20 minutes later (so 1 hour after the start) the API freezes and doesn't report any new data.Reproducible
You can use the test script below, to observe this behaviour in a reproducible way.
Test results
When starting the script, the following output is shown:
Let's make a mental note of the first time stamp
T09:27:01
.Every second the fetch is repeated, either responded by new quote data or an empty data frame.
Let the script run for the next hour.
Notice that the last received update has time stamp
T10:26:27
(so nearly 1 hour), followed by a few empty data frames:Then the last DEBUG log
degiro_connector.core.models.model_session:session:getter: MainThread
is shown, which stays unanswered forever.Questions
Test script
The script is based on this example, extended with exception handling and debug log level.
I've added 2 possible
vwd_id
s for tickers on both the European and North American market hours, so you get valid real-time data depending your testing time.Let the script run for 1 hour, and observe what happens after 1 hour (see section Test Results above).
The text was updated successfully, but these errors were encountered: