Skip to content

Commit 4b7214d

Browse files
committed
Fix docs
Signed-off-by: Danny Kopping <danny@coder.com>
1 parent 9380d8e commit 4b7214d

File tree

4 files changed

+105
-47
lines changed

4 files changed

+105
-47
lines changed

coderd/apidoc/docs.go

Lines changed: 27 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/apidoc/swagger.json

Lines changed: 27 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

codersdk/deployment.go

Lines changed: 35 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -458,24 +458,41 @@ type HealthcheckConfig struct {
458458
}
459459

460460
type NotificationsConfig struct {
461-
// Retries.
462-
MaxSendAttempts serpent.Int64 `json:"max_send_attempts" typescript:",notnull"`
463-
RetryInterval serpent.Duration `json:"retry_interval" typescript:",notnull"`
464-
465-
// Store updates.
466-
StoreSyncInterval serpent.Duration `json:"sync_interval" typescript:",notnull"`
467-
StoreSyncBufferSize serpent.Int64 `json:"sync_buffer_size" typescript:",notnull"`
468-
469-
// Queue.
470-
LeasePeriod serpent.Duration `json:"lease_period"`
471-
LeaseCount serpent.Int64 `json:"lease_count"`
461+
// The upper limit of attempts to send a notification.
462+
MaxSendAttempts serpent.Int64 `json:"max_send_attempts" typescript:",notnull"`
463+
// The minimum time between retries.
464+
RetryInterval serpent.Duration `json:"retry_interval" typescript:",notnull"`
465+
466+
// The notifications system buffers message updates in memory to ease pressure on the database.
467+
// This option controls how often it synchronizes its state with the database. The shorter this value the
468+
// lower the change of state inconsistency in a non-graceful shutdown - but it also increases load on the
469+
// database. It is recommended to keep this option at its default value.
470+
StoreSyncInterval serpent.Duration `json:"sync_interval" typescript:",notnull"`
471+
// The notifications system buffers message updates in memory to ease pressure on the database.
472+
// This option controls how many updates are kept in memory. The lower this value the
473+
// lower the change of state inconsistency in a non-graceful shutdown - but it also increases load on the
474+
// database. It is recommended to keep this option at its default value.
475+
StoreSyncBufferSize serpent.Int64 `json:"sync_buffer_size" typescript:",notnull"`
476+
477+
// How long a notifier should lease a message. This is effectively how long a notification is 'owned'
478+
// by a notifier, and once this period expires it will be available for lease by another notifier. Leasing
479+
// is important in order for multiple running notifiers to not pick the same messages to deliver concurrently.
480+
// This lease period will only expire if a notifier shuts down ungracefully; a dispatch of the notification
481+
// releases the lease.
482+
LeasePeriod serpent.Duration `json:"lease_period"`
483+
// How many notifications a notifier should lease per fetch interval.
484+
LeaseCount serpent.Int64 `json:"lease_count"`
485+
// How often to query the database for queued notifications.
472486
FetchInterval serpent.Duration `json:"fetch_interval"`
473487

474-
// Dispatch.
475-
Method serpent.String `json:"method"`
476-
DispatchTimeout serpent.Duration `json:"dispatch_timeout"`
477-
SMTP NotificationsEmailConfig `json:"email" typescript:",notnull"`
478-
Webhook NotificationsWebhookConfig `json:"webhook" typescript:",notnull"`
488+
// Which delivery method to use (available options: 'smtp', 'webhook').
489+
Method serpent.String `json:"method"`
490+
// How long to wait while a notification is being sent before giving up.
491+
DispatchTimeout serpent.Duration `json:"dispatch_timeout"`
492+
// SMTP settings.
493+
SMTP NotificationsEmailConfig `json:"email" typescript:",notnull"`
494+
// Webhook settings.
495+
Webhook NotificationsWebhookConfig `json:"webhook" typescript:",notnull"`
479496
}
480497

481498
type NotificationsEmailConfig struct {
@@ -500,12 +517,13 @@ type NotificationsEmailConfig struct {
500517
// // Identity used for PLAIN auth.
501518
// Identity serpent.String `json:"identity" typescript:",notnull"`
502519
// } `json:"auth" typescript:",notnull"`
503-
//// Additional headers to use in the SMTP request.
520+
// // Additional headers to use in the SMTP request.
504521
// Headers map[string]string `json:"headers" typescript:",notnull"`
505522
// TODO: TLS
506523
}
507524

508525
type NotificationsWebhookConfig struct {
526+
// The URL to which the payload will be sent with an HTTP POST request.
509527
Endpoint serpent.URL `json:"endpoint" typescript:",notnull"`
510528
}
511529

0 commit comments

Comments
 (0)