Skip to content

Implement rate limiting #4

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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Conversation

ragnarkurm
Copy link

  • Added possibility to acquire rate limit info from $bitvavo object
  • Documented that in README
  • Fixed minor spacing errors
  • Fixed some file endings
  • Made the lib PHP8 compatible (one small change)

@wimurk
Copy link

wimurk commented Apr 6, 2021

+1 i need this

@malle-pietje
Copy link

+1 same here, a welcome feature to help control API usage.

@wimurk
Copy link

wimurk commented Aug 12, 2021

Why is this still open? Is the Bitvavo developers team really small?
This is an very important code change and should have been prioritized.

foreach ($header as $h) {
if (preg_match('/^bitvavo-ratelimit-(limit|remaining|resetat): +(\d+)$/', $h, $match)) {
list(, $key, $value) = $match;
$this->ratelimit[$key] = (int) $value;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is very usefull.
One small bugfix for this PR on 32 bit systems.
Casting the resetat key to int will result in a max value of an int32: 2147483647
Casting to a float resolves this problem.

$this->ratelimit[$key] = (float)$value;

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jul 7, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

1 similar comment
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jul 7, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@zepzeper
Copy link

Is this still not implemented?

@wimurk
Copy link

wimurk commented Mar 14, 2023

Is this still not implemented?

Nope, sadly not

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants