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

Commit5bbb444

Browse files
committed
wording
1 parentf9317a5 commit5bbb444

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
@@ -60,9 +60,11 @@ type metrics struct {
6060
rateLimit*prometheus.GaugeVec
6161
rateLimitRemaining*prometheus.GaugeVec
6262
rateLimitUsed*prometheus.GaugeVec
63-
// rateLimitReset isthe timein secondsthe rate limit resets.
63+
// rateLimitReset isunix timeof the next interval (whenthe rate limit resets).
6464
rateLimitReset*prometheus.GaugeVec
6565
// rateLimitResetIn is the time in seconds until the rate limit resets.
66+
// This is included because it is sometimes more helpful to know the limit
67+
// will reset in 600seconds, rather than at 1704000000 unix time.
6668
rateLimitResetIn*prometheus.GaugeVec
6769
}
6870

@@ -114,7 +116,7 @@ func NewFactory(registry prometheus.Registerer) *Factory {
114116
Namespace:"coderd",
115117
Subsystem:"oauth2",
116118
Name:"external_requests_rate_limit_next_reset_unix",
117-
Help:"Unix timestampofthe next interval",
119+
Help:"Unix timestampfor whenthe next interval starts",
118120
}, []string{
119121
"name",
120122
"resource",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp