- Notifications
You must be signed in to change notification settings - Fork927
feat: implement observability of notifications subsystem#13799
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
7f60c0f
d62d704
96dac65
130de49
e868752
cee93cb
387b557
114797d
5ff29c0
88451a1
09f7305
91e2a23
9f1d6b3
15c4537
53ecad4
bc2a4cb
716e591
d408ed2
2b9eec3
4211c84
24417c5
72bb1be
bfca2c1
6602682
00633a1
f454184
84d07d4
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -935,12 +935,17 @@ func (q *FakeQuerier) AcquireNotificationMessages(_ context.Context, arg databas | ||
q.mutex.Lock() | ||
defer q.mutex.Unlock() | ||
// Shift the first "Count" notifications off the slice (FIFO). | ||
sz:=len(q.notificationMessages) | ||
dannykopping marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
ifsz > int(arg.Count) { | ||
sz = int(arg.Count) | ||
} | ||
list := q.notificationMessages[:sz] | ||
q.notificationMessages = q.notificationMessages[sz:] | ||
var out []database.AcquireNotificationMessagesRow | ||
for _, nm := range list { | ||
acquirableStatuses := []database.NotificationMessageStatus{database.NotificationMessageStatusPending, database.NotificationMessageStatusTemporaryFailure} | ||
if !slices.Contains(acquirableStatuses, nm.Status) { | ||
continue | ||
@@ -956,9 +961,9 @@ func (q *FakeQuerier) AcquireNotificationMessages(_ context.Context, arg databas | ||
ID: nm.ID, | ||
Payload: nm.Payload, | ||
Method: nm.Method, | ||
TitleTemplate: "This is a title with {{.Labels.variable}}", | ||
BodyTemplate: "This is a body with {{.Labels.variable}}", | ||
TemplateID: nm.NotificationTemplateID, | ||
}) | ||
} | ||
@@ -1815,10 +1820,10 @@ func (q *FakeQuerier) DeleteWorkspaceAgentPortSharesByTemplate(_ context.Context | ||
return nil | ||
} | ||
func (q *FakeQuerier) EnqueueNotificationMessage(_ context.Context, arg database.EnqueueNotificationMessageParams) error { | ||
err := validateDatabaseType(arg) | ||
if err != nil { | ||
return err | ||
} | ||
q.mutex.Lock() | ||
@@ -1827,7 +1832,7 @@ func (q *FakeQuerier) EnqueueNotificationMessage(_ context.Context, arg database | ||
var payload types.MessagePayload | ||
err = json.Unmarshal(arg.Payload, &payload) | ||
if err != nil { | ||
return err | ||
} | ||
nm := database.NotificationMessage{ | ||
@@ -1845,7 +1850,7 @@ func (q *FakeQuerier) EnqueueNotificationMessage(_ context.Context, arg database | ||
q.notificationMessages = append(q.notificationMessages, nm) | ||
return err | ||
} | ||
func (q *FakeQuerier) FavoriteWorkspace(_ context.Context, arg uuid.UUID) error { | ||
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ALTER TABLE notification_messages | ||
DROP COLUMN IF EXISTS queued_seconds; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ALTER TABLE notification_messages | ||
ADD COLUMN queued_seconds FLOAT NULL; |
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.