Skip to content
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

import data from wakatime timeout #43

Closed
WankkoRee opened this issue Aug 31, 2021 · 5 comments
Closed

import data from wakatime timeout #43

WankkoRee opened this issue Aug 31, 2021 · 5 comments
Labels
bug Something isn't working

Comments

@WankkoRee
Copy link

I am in Hong Kong. If i use api.wakatime.com, it will time out. But if I use wakatime.com, then everything works fine.

image

So can there be an option in docker-compose-deploy.yml for setting importing from which domain? Just like HAKA_WAKATIME_HOST: "wakatime.com"

@mujx
Copy link
Owner

mujx commented Aug 31, 2021

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?

@WankkoRee
Copy link
Author

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.

@mujx
Copy link
Owner

mujx commented Aug 31, 2021

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.

@mujx mujx added the bug Something isn't working label Aug 31, 2021
mujx pushed a commit that referenced this issue Aug 31, 2021
The former endpoint was incorrectly returning HTML instead of JSON and
wasn't working over HTTPS.

Relevant issue: #43
@mujx
Copy link
Owner

mujx commented Aug 31, 2021

@WankkoRee I pushed a quick fix that uses the correct endpoint (wakatime.com). In the future this will be configurable.

@WankkoRee
Copy link
Author

Thank you for your timely fix. I tried to import again and everything was working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants