Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit36d7d39

Browse files
committed
wording
1 parentf13df6f commit36d7d39

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

‎coderd/promoauth/github.go‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func githubRateLimits(resp *http.Response, err error) (rateLimits, bool) {
2828
Limit:p.int("x-ratelimit-limit"),
2929
Remaining:p.int("x-ratelimit-remaining"),
3030
Used:p.int("x-ratelimit-used"),
31-
Resource:p.header.Get("x-ratelimit-resource"),
31+
Resource:p.string("x-ratelimit-resource"),
3232
}
3333

3434
iflimits.Limit==0&&
@@ -74,7 +74,7 @@ type headerParser struct {
7474
header http.Header
7575
}
7676

77-
func (p*headerParser)int(keystring)int {
77+
func (p*headerParser)string(keystring)string {
7878
ifp.errors==nil {
7979
p.errors=make(map[string]error)
8080
}
@@ -83,6 +83,14 @@ func (p *headerParser) int(key string) int {
8383
ifv=="" {
8484
p.errors[key]=fmt.Errorf("missing header %q",key)
8585
}
86+
returnv
87+
}
88+
89+
func (p*headerParser)int(keystring)int {
90+
v:=p.string(key)
91+
ifv=="" {
92+
return-1
93+
}
8694

8795
i,err:=strconv.Atoi(v)
8896
iferr!=nil {

‎coderd/promoauth/oauth2.go‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,11 @@ type metrics struct {
5050
rateLimit*prometheus.GaugeVec
5151
rateLimitRemaining*prometheus.GaugeVec
5252
rateLimitUsed*prometheus.GaugeVec
53-
// rateLimitReset isthe timein secondsthe rate limit resets.
53+
// rateLimitReset isunix timeof the next interval (whenthe rate limit resets).
5454
rateLimitReset*prometheus.GaugeVec
5555
// rateLimitResetIn is the time in seconds until the rate limit resets.
56+
// This is included because it is sometimes more helpful to know the limit
57+
// will reset in 600seconds, rather than at 1704000000 unix time.
5658
rateLimitResetIn*prometheus.GaugeVec
5759
}
5860

@@ -104,7 +106,7 @@ func NewFactory(registry prometheus.Registerer) *Factory {
104106
Namespace:"coderd",
105107
Subsystem:"oauth2",
106108
Name:"external_requests_rate_limit_next_reset_unix",
107-
Help:"Unix timestampofthe next interval",
109+
Help:"Unix timestampfor whenthe next interval starts",
108110
}, []string{
109111
"name",
110112
"resource",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp