Closed WankkoRee closed 2 years ago
Are you sure the problem is your location and not the amount of data you're expecting? Maybe the server is slow to respond and a second try will most likely fetch your data.
You can check that both wakatime.com
& api.wakatime.com
are in California, USA so the latency should be the same. Or is api.wakatime.com
blocked in Hong Kong?
Look at the screenshot I uploaded earlier. I did not set user credentials such as cookies and tokens. I just send an anonymous request. But the response time of the two domains is quite different.
You're right. It seems like the api.wakatime.com
is only redirecting to wakatime.com/api
on HTTP . This will work curl http://api.wakatime.com/v1/users/current/heartbeats
, but it returns HTML instead of JSON. Removing the /api
path with HTTPS likecurl https://api.wakatime.com/v1/users/current/heartbeats
also works but still no JSON.
I'll provide a variable to control this endpoint. Thanks for the suggestion.
@WankkoRee I pushed a quick fix that uses the correct endpoint (wakatime.com
). In the future this will be configurable.
Thank you for your timely fix. I tried to import again and everything was working.
I am in Hong Kong. If i use
api.wakatime.com
, it will time out. But if I usewakatime.com
, then everything works fine.So can there be an option in
docker-compose-deploy.yml
for setting importing from which domain? Just likeHAKA_WAKATIME_HOST: "wakatime.com"