MCPcopy Index your code
hub / github.com/coder/coder / newNotifier

Function newNotifier

coderd/notifications/notifier.go:68–86  ·  view source on GitHub ↗
(outerCtx context.Context, cfg codersdk.NotificationsConfig, id uuid.UUID, log slog.Logger, db Store,
	hr map[database.NotificationMethod]Handler, helpers template.FuncMap, metrics *Metrics, clock quartz.Clock,
)

Source from the content-addressed store, hash-verified

66}
67
68func newNotifier(outerCtx context.Context, cfg codersdk.NotificationsConfig, id uuid.UUID, log slog.Logger, db Store,
69 hr map[database.NotificationMethod]Handler, helpers template.FuncMap, metrics *Metrics, clock quartz.Clock,
70) *notifier {
71 gracefulCtx, gracefulCancel := context.WithCancel(outerCtx)
72 return &notifier{
73 id: id,
74 cfg: cfg,
75 log: log.Named("notifier").With(slog.F("notifier_id", id)),
76 outerCtx: outerCtx,
77 gracefulCtx: gracefulCtx,
78 gracefulCancel: gracefulCancel,
79 done: make(chan any),
80 store: db,
81 handlers: hr,
82 helpers: helpers,
83 metrics: metrics,
84 clock: clock,
85 }
86}
87
88// run is the main loop of the notifier.
89func (n *notifier) run(success chan<- dispatchResult, failure chan<- dispatchResult) error {

Callers 1

loopMethod · 0.85

Calls 1

NamedMethod · 0.80

Tested by

no test coverage detected