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

Function NewService

coderd/x/chatd/chatdebug/service.go:145–162  ·  view source on GitHub ↗

NewService constructs a chat debug persistence service.

(db database.Store, log slog.Logger, ps pubsub.Pubsub, opts ...ServiceOption)

Source from the content-addressed store, hash-verified

143
144// NewService constructs a chat debug persistence service.
145func NewService(db database.Store, log slog.Logger, ps pubsub.Pubsub, opts ...ServiceOption) *Service {
146 if db == nil {
147 panic("chatdebug: nil database.Store")
148 }
149
150 s := &Service{
151 db: db,
152 log: log,
153 pubsub: ps,
154 clock: quartz.NewReal(),
155 thresholdChanged: make(chan struct{}),
156 }
157 s.staleAfterNanos.Store(DefaultStaleThreshold.Nanoseconds())
158 for _, opt := range opts {
159 opt(s)
160 }
161 return s
162}
163
164// SetStaleAfter overrides the in-flight stale threshold used when
165// finalizing abandoned debug rows. Zero or negative durations are

Calls 1

StoreMethod · 0.45