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

Commit15c4537

Browse files
committed
Small touch-ups
Signed-off-by: Danny Kopping <danny@coder.com>
1 parent9f1d6b3 commit15c4537

File tree

4 files changed

+17
-16
lines changed

4 files changed

+17
-16
lines changed

‎coderd/database/dbmock/dbmock.go

Lines changed: 3 additions & 4 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎coderd/database/queries.sql.go

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎coderd/database/queries/notifications.sql

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ FROM acquired nm
8989

9090
-- name: BulkMarkNotificationMessagesFailed :execrows
9191
UPDATE notification_messages
92-
SET updated_at=subquery.failed_at,
92+
SET queued_seconds=0,
93+
updated_at=subquery.failed_at,
9394
attempt_count= attempt_count+1,
9495
status= CASE
9596
WHEN attempt_count+1< @max_attempts::int THENsubquery.status
@@ -107,7 +108,8 @@ WHERE notification_messages.id = subquery.id;
107108

108109
-- name: BulkMarkNotificationMessagesSent :execrows
109110
UPDATE notification_messages
110-
SET updated_at=new_values.sent_at,
111+
SET queued_seconds=0,
112+
updated_at=new_values.sent_at,
111113
attempt_count= attempt_count+1,
112114
status='sent'::notification_message_status,
113115
status_reason=NULL,

‎coderd/notifications/metrics_test.go

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,14 @@ func TestMetrics(t *testing.T) {
9292
notifications.ResultPermFail:1,// 1 permanent failure after retries exhausted.
9393
}
9494

95-
vartarget*float64
95+
varmatchstring
9696
forresult,val:=rangeresults {
9797
seriesFP:=fingerprintLabels(notifications.LabelMethod,string(method),notifications.LabelTemplateID,template.String(),notifications.LabelResult,result)
9898
if!hasMatchingFingerprint(metric,seriesFP) {
9999
continue
100100
}
101101

102-
target=&val
102+
match=result
103103

104104
ifdebug {
105105
t.Logf("coderd_notifications_dispatch_attempts_total{result=%q} == %v: %v",result,val,metric.Counter.GetValue())
@@ -109,16 +109,14 @@ func TestMetrics(t *testing.T) {
109109
}
110110

111111
// Could not find a matching series.
112-
iftarget==nil {
112+
ifmatch=="" {
113113
assert.Failf(t,"found unexpected series %q",series)
114114
returnfalse
115115
}
116116

117-
ifmetric.Counter.GetValue()!=*target {
118-
returnfalse
119-
}
120-
121-
returntrue
117+
// nolint:forcetypeassert // Already checked above.
118+
target:=results[match]
119+
returnmetric.Counter.GetValue()==target
122120
},
123121
"coderd_notifications_retry_count":func(metric*dto.Metric,seriesstring)bool {
124122
assert.Truef(t,hasMatchingFingerprint(metric,methodTemplateFP),"found unexpected series %q",series)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp