-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement serial rate limiter with backoff
- Loading branch information
Showing
2 changed files
with
79 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
namespace Jellyfin.Plugin.ListenBrainz.Api.Resources; | ||
|
||
/// <summary> | ||
/// ListenBrainz API custom headers. | ||
/// </summary> | ||
public static class Headers | ||
{ | ||
/// <summary> | ||
/// Number of requests allowed in given time window. | ||
/// </summary> | ||
public const string RateLimitLimit = "X-RateLimit-Limit"; | ||
|
||
/// <summary> | ||
/// Number of requests remaining in current time window. | ||
/// </summary> | ||
public const string RateLimitRemaining = "X-RateLimit-Remaining"; | ||
|
||
/// <summary> | ||
/// Number of seconds when current time window expires (recommended: this header is resilient against clients with incorrect clocks). | ||
/// </summary> | ||
public const string RateLimitResetIn = "X-RateLimit-Reset-In"; | ||
|
||
/// <summary> | ||
/// UNIX epoch number of seconds (without timezone) when current time window expires. | ||
/// </summary> | ||
public const string RateLimitReset = "X-RateLimit-Reset"; | ||
} |