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

/user/limits in bits or bytes #150

Merged
merged 2 commits into from
Mar 17, 2022
Merged

/user/limits in bits or bytes #150

merged 2 commits into from
Mar 17, 2022

Conversation

ro-tex
Copy link
Contributor

@ro-tex ro-tex commented Mar 10, 2022

PULL REQUEST

Overview

The /limits endpoint returns the bandwidth limits in bits per second, which is the format most people expect to see.
The /user/limits endpoint, though, returns the bandwidth in bytes per second because that is what Nginx expects to see.

This discrepancy is very confusing for users and it needs to be resolved. To that end this PR adds a new query parameter which would let Nginx request the limits in bytes (see SkynetLabs/skynet-webportal#1855) while everyone else will receive the limits in bits.

Example for Visual Changes

Checklist

Review and complete the checklist to ensure that the PR is complete before assigned to an approver.

  • All new methods or updated methods have clear docstrings
  • Testing added or updated for new methods
  • Verify if any changes impact the WebPortal Health Checks
  • Approriate documentation updated
  • Changelog file created

Issues Closed

… second to bytes per second (current default).
api/handlers.go Outdated Show resolved Hide resolved
@ro-tex
Copy link
Contributor Author

ro-tex commented Mar 17, 2022

DO NOT MERGE!

Nginx is not passing the right query parameters when asking for user limits, so if we merge this right now it will get the answer in bits and interpret it in bytes.

Blocker: SkynetLabs/skynet-webportal#1855

@ro-tex ro-tex merged commit 9533fae into main Mar 17, 2022
@kwypchlo kwypchlo deleted the ivo/limits_in_bytes branch March 17, 2022 16:03
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.

3 participants