vercel / hazel

Lightweight update server for Electron apps
https://twitter.com/notquiteleo/status/893547786255421441
MIT License
2.9k stars 385 forks source link

Throw an error if `INTERVAL` env variable is below 1 minute #12

Open zeke opened 7 years ago

zeke commented 7 years ago

It appears that hazel is making unauthenticated requests to the GitHub API.. is that correct?

If so, a running instance will quickly go over its unauthenticated request limit.

leo commented 7 years ago

Check the INTERVAL env variable here. What we can do is throw an error if people chose a lower interval than 1m or 2m (60 reqs per hour are allowed).

zeke commented 7 years ago

So.. unauthenticated requests then, right?

leo commented 7 years ago

@zeke Correct. All unauthenticated. That's what makes Hazel so fast and powerful: It only abstracts the necessary. If you need server-side caching / private repos, there's Nuts... 😊

zeke commented 7 years ago

I see. So hazel will only make a request to the GitHub API every INTERVAL minute(s), even though apps will be asking hazel for that info much more frequently.

Does every Now app get its own IP address?

leo commented 7 years ago

I see. So hazel will only make a request to the GitHub API every INTERVAL minute(s), even though apps will be asking hazel for that info much more frequently.

Correct.

Does every Now app get its own IP address?

Depends. Sometimes they're on the same IP.

zeke commented 7 years ago

I ask because unauthenticated GitHub API requests are tallied by IP. It might be worth defaulting to a longer interval to reduce the likelihood of contention across apps.