Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
func New(ctx context.Context, logger slog.Logger, db database.Store, vals *codersdk.DeploymentValues, reg prometheus.Registerer, auditor *atomic.Pointer[audit.Auditor], opts ...Option) io.Closer
New creates a new periodically purging database instance. Callers must Close the returned instance.
The auditor pointer is loaded on each dispatch tick so runtime entitlement changes (e.g. toggling the audit-log feature) take effect without restarting the process. Notifications enqueuer defaults to no-op. Use WithNotificationsEnqueuer to pass a real one.
Types ¶
type Option ¶ added in v2.33.0
type Option func(*instance)
func WithChatAutoArchiveBatchSize ¶ added in v2.33.0
WithChatAutoArchiveBatchSize overrides how many root chats a single tick will auto-archive. Defaults to defaultChatAutoArchiveBatchSize (1000).
func WithClock ¶ added in v2.33.0
WithClock overrides the clock used by the purger. Defaults to quartz.NewReal().
func WithNotificationsEnqueuer ¶ added in v2.33.0
func WithNotificationsEnqueuer(e notifications.Enqueuer) Option
WithNotificationsEnqueuer sets the enqueuer used for digest notifications. Defaults to notifications.NewNoopEnqueuer(). Panics if e is nil: a nil enqueuer would NPE on the first dispatch tick, and failing fast at option-apply time surfaces the misuse at startup rather than minutes later.