Session Errors
Closed this issue · 6 comments
Hi, I just had a question regarding the following error. Is this something that is fixable on my end or am I being API limited? The error happens after about an hour of consistently pulling the current readings every 30 seconds. Thanks!
dexcom = Dexcom(self._credentials["username"], self._credentials["password"])
dexcom.create_session()
bg = dexcom.get_current_glucose_reading()
I'd be surprised if it's an API rate limit. You're not pegging it at something silly like a request a second, haha.
Are you running just this line every 30 seconds?
bg = dexcom.get_current_glucose_reading()
For what it's worth, the create_session
and overall session handling is handled by the call to get_current_glucose_reading
-- no need for the separate call to create_session
.
I have to agree with that because the Dexcom API has a limit of 60,000 requests per hour, so I was very confused when I saw that haha. I will remove the create_session
call since it is unnecessary.
Regarding the code being executed, the bg.value
is pumped into a few different algorithms and the data is stored via MySQL. The whole script is synchronous and the goal in mind was to try to predict the next BG level with linear regression. This data would let me trigger some warning notifications in the event of a low BG level overnight.
I already tried researching the 504 error with the MySQL connector, but no luck. I saw an older issue in here regarding a Session ID being stated as default or something along those lines. The error seemed like it was coming from this library. Any clue why?
Ah. I started picking up sessions errors this morning as well (it's been stable for 6+ months). My assumption is that the API has been tweaked. Looking into it.
No worries and thanks for looking into it!
Did anyone ever determine what the rate is? I’ve got a script that kicks off every 5 minutes and it keeps getting caught up in it
The API seems stable again. Thanks everyone!