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

Function WithEventChannel

coderd/database/dbrollup/dbrollup.go:48–55  ·  view source on GitHub ↗

WithEventChannel sets the event channel to use for rollup events. This is only used for testing.

(ch chan<- Event)

Source from the content-addressed store, hash-verified

46//
47// This is only used for testing.
48func WithEventChannel(ch chan<- Event) Option {
49 if flag.Lookup("test.v") == nil {
50 panic("developer error: WithEventChannel is not to be used outside of tests")
51 }
52 return func(r *Rolluper) {
53 r.event = ch
54 }
55}
56
57// New creates a new DB rollup service that periodically runs rollup queries.
58// It is the caller's responsibility to call Close on the returned instance.

Calls

no outgoing calls