@@ -458,24 +458,41 @@ type HealthcheckConfig struct {
458
458
}
459
459
460
460
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.
472
486
FetchInterval serpent.Duration `json:"fetch_interval"`
473
487
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"`
479
496
}
480
497
481
498
type NotificationsEmailConfig struct {
@@ -500,12 +517,13 @@ type NotificationsEmailConfig struct {
500
517
// // Identity used for PLAIN auth.
501
518
// Identity serpent.String `json:"identity" typescript:",notnull"`
502
519
// } `json:"auth" typescript:",notnull"`
503
- //// Additional headers to use in the SMTP request.
520
+ // // Additional headers to use in the SMTP request.
504
521
// Headers map[string]string `json:"headers" typescript:",notnull"`
505
522
// TODO: TLS
506
523
}
507
524
508
525
type NotificationsWebhookConfig struct {
526
+ // The URL to which the payload will be sent with an HTTP POST request.
509
527
Endpoint serpent.URL `json:"endpoint" typescript:",notnull"`
510
528
}
511
529
0 commit comments