@@ -920,34 +920,30 @@ func (r *RootCmd) Server(newAPI func(context.Context, *coderd.Options) (*coderd.
920
920
notificationsManager * notifications.Manager
921
921
)
922
922
923
- if notificationsCfg .Enabled () {
924
- metrics := notifications .NewMetrics (options .PrometheusRegistry )
925
- helpers := templateHelpers (options )
923
+ metrics := notifications .NewMetrics (options .PrometheusRegistry )
924
+ helpers := templateHelpers (options )
926
925
927
- // The enqueuer is responsible for enqueueing notifications to the given store.
928
- enqueuer , err := notifications .NewStoreEnqueuer (notificationsCfg , options .Database , helpers , logger .Named ("notifications.enqueuer" ), quartz .NewReal ())
929
- if err != nil {
930
- return xerrors .Errorf ("failed to instantiate notification store enqueuer: %w" , err )
931
- }
932
- options .NotificationsEnqueuer = enqueuer
926
+ // The enqueuer is responsible for enqueueing notifications to the given store.
927
+ enqueuer , err := notifications .NewStoreEnqueuer (notificationsCfg , options .Database , helpers , logger .Named ("notifications.enqueuer" ), quartz .NewReal ())
928
+ if err != nil {
929
+ return xerrors .Errorf ("failed to instantiate notification store enqueuer: %w" , err )
930
+ }
931
+ options .NotificationsEnqueuer = enqueuer
933
932
934
- // The notification manager is responsible for:
935
- // - creating notifiers and managing their lifecycles (notifiers are responsible for dequeueing/sending notifications)
936
- // - keeping the store updated with status updates
937
- notificationsManager , err = notifications .NewManager (notificationsCfg , options .Database , options .Pubsub , helpers , metrics , logger .Named ("notifications.manager" ))
938
- if err != nil {
939
- return xerrors .Errorf ("failed to instantiate notification manager: %w" , err )
940
- }
933
+ // The notification manager is responsible for:
934
+ // - creating notifiers and managing their lifecycles (notifiers are responsible for dequeueing/sending notifications)
935
+ // - keeping the store updated with status updates
936
+ notificationsManager , err = notifications .NewManager (notificationsCfg , options .Database , options .Pubsub , helpers , metrics , logger .Named ("notifications.manager" ))
937
+ if err != nil {
938
+ return xerrors .Errorf ("failed to instantiate notification manager: %w" , err )
939
+ }
941
940
942
- // nolint:gocritic // We need to run the manager in a notifier context.
943
- notificationsManager .Run (dbauthz .AsNotifier (ctx ))
941
+ // nolint:gocritic // We need to run the manager in a notifier context.
942
+ notificationsManager .Run (dbauthz .AsNotifier (ctx ))
944
943
945
- // Run report generator to distribute periodic reports.
946
- notificationReportGenerator := reports .NewReportGenerator (ctx , logger .Named ("notifications.report_generator" ), options .Database , options .NotificationsEnqueuer , quartz .NewReal ())
947
- defer notificationReportGenerator .Close ()
948
- } else {
949
- logger .Debug (ctx , "notifications are currently disabled as there are no configured delivery methods. See https://coder.com/docs/admin/monitoring/notifications#delivery-methods for more details" )
950
- }
944
+ // Run report generator to distribute periodic reports.
945
+ notificationReportGenerator := reports .NewReportGenerator (ctx , logger .Named ("notifications.report_generator" ), options .Database , options .NotificationsEnqueuer , quartz .NewReal ())
946
+ defer notificationReportGenerator .Close ()
951
947
952
948
// Since errCh only has one buffered slot, all routines
953
949
// sending on it must be wrapped in a select/default to
0 commit comments