feat(coderd): notify when workspace is marked as dormant (#13868)
This commit is contained in:
@@ -7,9 +7,8 @@ import (
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
type FakeNotificationEnqueuer struct {
|
||||
mu sync.Mutex
|
||||
|
||||
type FakeNotificationsEnqueuer struct {
|
||||
mu sync.Mutex
|
||||
Sent []*Notification
|
||||
}
|
||||
|
||||
@@ -20,7 +19,7 @@ type Notification struct {
|
||||
Targets []uuid.UUID
|
||||
}
|
||||
|
||||
func (f *FakeNotificationEnqueuer) Enqueue(_ context.Context, userID, templateID uuid.UUID, labels map[string]string, createdBy string, targets ...uuid.UUID) (*uuid.UUID, error) {
|
||||
func (f *FakeNotificationsEnqueuer) Enqueue(_ context.Context, userID, templateID uuid.UUID, labels map[string]string, createdBy string, targets ...uuid.UUID) (*uuid.UUID, error) {
|
||||
f.mu.Lock()
|
||||
defer f.mu.Unlock()
|
||||
|
||||
@@ -35,3 +34,10 @@ func (f *FakeNotificationEnqueuer) Enqueue(_ context.Context, userID, templateID
|
||||
id := uuid.New()
|
||||
return &id, nil
|
||||
}
|
||||
|
||||
func (f *FakeNotificationsEnqueuer) Clear() {
|
||||
f.mu.Lock()
|
||||
defer f.mu.Unlock()
|
||||
|
||||
f.Sent = nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user