background

package
v0.26.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 23, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartBackgroundScorer

func StartBackgroundScorer(ctx context.Context, store *postgres.Store, gh ghclient.Client, version string) func()

StartBackgroundScorer runs a continuous scoring loop that pauses when aggregate token quota drops below the configured threshold. Returns a cancel function to stop the loop.

func StartIngestLoop

func StartIngestLoop(ctx context.Context, run IngestFunc, interval time.Duration) func()

StartIngestLoop runs the given function immediately, then on a ticker interval. If interval is 0, it reads INGEST_INTERVAL_SEC (default 600s). Returns a cancel function to stop the loop.

func StartQuotaSampler

func StartQuotaSampler(ctx context.Context, store *postgres.Store, pool *ghclient.TokenPool) func()

StartQuotaSampler periodically records token rate-limit snapshots. Returns a cancel function to stop the sampler.

Types

type IngestFunc

type IngestFunc func(ctx context.Context) error

IngestFunc is the function signature for a single ingest run.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL