Skip to main content

My app queries personal Koms every 30 mins starting 6am (CEST) up until 12pm and compares it to previous data to log lost/gained Koms.

Everything works fine except the first query in the morning at 6am which has almost half the get-requests being returned with empty arrays even though their status is 200. The number of empty requests is non-deterministic, meaning sometimes It fetches 2200 of ca. 4000 Koms sometimes less, sometimes more.

Here is a small excerpt of my server logs from 6am:

 

<br>

** Fetching From Database: ids<br>

** Fetching Tokens - EXPIRED<br>

** Refreshing Tokens - SUCCESS<br>

** DatabaseID count: 4010<br>

** Fetching Kom Pages<br>

** Fetching Kom Page 1<br>

** Fetching Kom Page 2<br>

** Fetching Kom Page 3<br>

** Fetching Kom Page 4<br>

** Fetching Kom Page 5<br>

** Fetching Kom Page 6<br>

** Fetching Kom Page 7<br>

** Fetching Kom Page 8<br>

** Fetching Kom Page 9<br>

** Fetching Kom Page 10<br>

** Fetching Kom Page 11<br>

** Fetching Kom Page 12<br>

** Fetching Kom Page 13<br>

** Fetching Kom Page 14<br>

** Fetching Kom Page 15<br>

** Fetching Kom Page 16<br>

** Fetching Kom Page 17<br>

** Fetching Kom Page 18<br>

** Fetching Kom Page 19<br>

** Fetching Kom Page 20<br>

** Fetching Kom Page 21<br>

** Fetching Kom Page 22<br>

** Pulled 0 Koms from Page 12 - Status: 200<br>

** Pulled 0 Koms from Page 5 - Status: 200<br>

** Pulled 0 Koms from Page 11 - Status: 200<br>

** Pulled 0 Koms from Page 21 - Status: 200<br>

** Pulled 0 Koms from Page 15 - Status: 200<br>

** Pulled 0 Koms from Page 3 - Status: 200<br>

** Pulled 0 Koms from Page 16 - Status: 200<br>

** Pulled 0 Koms from Page 20 - Status: 200<br>

** Pulled 0 Koms from Page 6 - Status: 200<br>

** Pulled 0 Koms from Page 18 - Status: 200<br>

** Pulled 200 Koms from Page 17 - Status: 200<br>

** Pulled 200 Koms from Page 9 - Status: 200<br>

** Pulled 200 Koms from Page 2 - Status: 200<br>

** Pulled 200 Koms from Page 10 - Status: 200<br>

** Pulled 200 Koms from Page 13 - Status: 200<br>

** Pulled 200 Koms from Page 19 - Status: 200<br>

** Pulled 200 Koms from Page 4 - Status: 200<br>

** Pulled 200 Koms from Page 1 - Status: 200<br>

** Pulled 200 Koms from Page 14 - Status: 200<br>

** Pulled 200 Koms from Page 8 - Status: 200<br>

** Pulled 0 Koms from Page 22 - Status: 200<br>

** Pulled 200 Koms from Page 7 - Status: 200<br>

** Fetching From Database: snapshot<br>

** Lost; 10084506<br>

****** (2000 more Lines of lost Koms which I'll leave out)*******



** Pushing Database Updates: <br> IDs: 2200<br> Date: Fri Aug 23 2024<br>

** Pushing Token Update, expires: 1724405214000

 

This is the http-request: 

 

const res = await axios({

method: 'GET',

url: `https://www.strava.com/api/v3/athletes/${athleteId}/koms?page=${page}&per_page=200`,

headers: { Authorization: 'Bearer ' + token },

})

 

Every other request to the Strava-Api works flawless. It's just the one at 6am that returns with empty arrays which pollutes my data.

I'm happy for any help.

Be the first to reply!

Reply