Documentation
¶
Overview ¶
Package maintenance runs plugin background jobs and provider upkeep.
Responsibilities:
- Scheduling colocated plugin jobs per provider instance
- Syncing opted-in model lists on the same tick
- Cleaning expired auth flows
Design principles:
- Plugin-owned: each backend decides its own jobs and schedules; the core only triggers, bounds concurrency and records outcomes
- Non-blocking: runs in a background goroutine; errors are logged, never fatal
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service runs background jobs for provider plugins.
func New ¶
func New(luaSvc *luaplugin.Service, providerSvc *provider.Service, database *db.DB, logger *slog.Logger) *Service
New constructs a new maintenance Service with the default check interval.
func (*Service) RunJob ¶ added in v0.3.8
RunJob triggers one job for one provider on demand (dashboard). Unknown jobs fail loudly; running jobs report busy.
func (*Service) RunStartupRefresh ¶ added in v0.3.7
RunStartupRefresh runs startup jobs and cleans expired auth flows synchronously. The server calls it before listening so a restarted router never serves traffic with stale plugin state. It never fails startup: every outcome logs inside the pass, and cancellation only stops launching new workers.
func (*Service) SetModelInfoService ¶
func (s *Service) SetModelInfoService(mi modelInfoRefresher)
SetModelInfoService wires model metadata refresh for providers with config.models_auto_sync enabled.