@@ -56,15 +56,16 @@ import (
56
56
57
57
"cdr.dev/slog"
58
58
"cdr.dev/slog/sloggers/sloghuman"
59
- "github.com/coder/coder/v2/coderd/entitlements"
60
- "github.com/coder/coder/v2/coderd/notifications/reports"
61
- "github.com/coder/coder/v2/coderd/runtimeconfig"
62
59
"github.com/coder/pretty"
63
60
"github.com/coder/quartz"
64
61
"github.com/coder/retry"
65
62
"github.com/coder/serpent"
66
63
"github.com/coder/wgtunnel/tunnelsdk"
67
64
65
+ "github.com/coder/coder/v2/coderd/entitlements"
66
+ "github.com/coder/coder/v2/coderd/notifications/reports"
67
+ "github.com/coder/coder/v2/coderd/runtimeconfig"
68
+
68
69
"github.com/coder/coder/v2/buildinfo"
69
70
"github.com/coder/coder/v2/cli/clilog"
70
71
"github.com/coder/coder/v2/cli/cliui"
@@ -679,10 +680,6 @@ func (r *RootCmd) Server(newAPI func(context.Context, *coderd.Options) (*coderd.
679
680
options .OIDCConfig = oc
680
681
}
681
682
682
- experiments := coderd .ReadExperiments (
683
- options .Logger , options .DeploymentValues .Experiments .Value (),
684
- )
685
-
686
683
// We'll read from this channel in the select below that tracks shutdown. If it remains
687
684
// nil, that case of the select will just never fire, but it's important not to have a
688
685
// "bare" read on this channel.
@@ -1006,33 +1003,31 @@ func (r *RootCmd) Server(newAPI func(context.Context, *coderd.Options) (*coderd.
1006
1003
var (
1007
1004
notificationsManager * notifications.Manager
1008
1005
)
1009
- if experiments .Enabled (codersdk .ExperimentNotifications ) {
1010
- cfg := options .DeploymentValues .Notifications
1011
- metrics := notifications .NewMetrics (options .PrometheusRegistry )
1012
- helpers := templateHelpers (options )
1006
+ cfg := options .DeploymentValues .Notifications
1007
+ metrics := notifications .NewMetrics (options .PrometheusRegistry )
1008
+ helpers := templateHelpers (options )
1013
1009
1014
- // The enqueuer is responsible for enqueueing notifications to the given store.
1015
- enqueuer , err := notifications .NewStoreEnqueuer (cfg , options .Database , helpers , logger .Named ("notifications.enqueuer" ), quartz .NewReal ())
1016
- if err != nil {
1017
- return xerrors .Errorf ("failed to instantiate notification store enqueuer: %w" , err )
1018
- }
1019
- options .NotificationsEnqueuer = enqueuer
1010
+ // The enqueuer is responsible for enqueueing notifications to the given store.
1011
+ enqueuer , err := notifications .NewStoreEnqueuer (cfg , options .Database , helpers , logger .Named ("notifications.enqueuer" ), quartz .NewReal ())
1012
+ if err != nil {
1013
+ return xerrors .Errorf ("failed to instantiate notification store enqueuer: %w" , err )
1014
+ }
1015
+ options .NotificationsEnqueuer = enqueuer
1020
1016
1021
- // The notification manager is responsible for:
1022
- // - creating notifiers and managing their lifecycles (notifiers are responsible for dequeueing/sending notifications)
1023
- // - keeping the store updated with status updates
1024
- notificationsManager , err = notifications .NewManager (cfg , options .Database , helpers , metrics , logger .Named ("notifications.manager" ))
1025
- if err != nil {
1026
- return xerrors .Errorf ("failed to instantiate notification manager: %w" , err )
1027
- }
1017
+ // The notification manager is responsible for:
1018
+ // - creating notifiers and managing their lifecycles (notifiers are responsible for dequeueing/sending notifications)
1019
+ // - keeping the store updated with status updates
1020
+ notificationsManager , err = notifications .NewManager (cfg , options .Database , helpers , metrics , logger .Named ("notifications.manager" ))
1021
+ if err != nil {
1022
+ return xerrors .Errorf ("failed to instantiate notification manager: %w" , err )
1023
+ }
1028
1024
1029
- // nolint:gocritic // TODO: create own role.
1030
- notificationsManager .Run (dbauthz .AsSystemRestricted (ctx ))
1025
+ // nolint:gocritic // TODO: create own role.
1026
+ notificationsManager .Run (dbauthz .AsSystemRestricted (ctx ))
1031
1027
1032
- // Run report generator to distribute periodic reports.
1033
- notificationReportGenerator := reports .NewReportGenerator (ctx , logger .Named ("notifications.report_generator" ), options .Database , options .NotificationsEnqueuer , quartz .NewReal ())
1034
- defer notificationReportGenerator .Close ()
1035
- }
1028
+ // Run report generator to distribute periodic reports.
1029
+ notificationReportGenerator := reports .NewReportGenerator (ctx , logger .Named ("notifications.report_generator" ), options .Database , options .NotificationsEnqueuer , quartz .NewReal ())
1030
+ defer notificationReportGenerator .Close ()
1036
1031
1037
1032
// Wrap the server in middleware that redirects to the access URL if
1038
1033
// the request is not to a local IP.
0 commit comments