intelrollup

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package intelrollup materializes reusable, per-day character intelligence.

Index

Constants

View Source
const (
	RetentionDays          = 365
	RepairDays             = 3
	RecentRefreshDelay     = 5 * time.Minute
	HistoricalRefreshDelay = 6 * time.Hour
)

Variables

This section is empty.

Functions

func IsDirty added in v0.1.41

func IsDirty(ctx context.Context, pool *pgxpool.Pool, day time.Time) (bool, error)

IsDirty reports whether newer ingest arrived while a day was rebuilding.

func PrepareMaintenance added in v0.1.41

func PrepareMaintenance(ctx context.Context, pool *pgxpool.Pool) ([]time.Time, error)

PrepareMaintenance marks the recent repair window dirty, removes expired facts, and returns every day whose durable marker still needs processing.

func RefreshDelay added in v0.1.94

func RefreshDelay(day, now time.Time) time.Duration

RefreshDelay batches arrivals by UTC activity day. Historical corrections remain durable in dirty_days, but need not rebuild a whole day every five minutes. Keep yesterday responsive for kills posted across UTC midnight.

Types

type Result

type Result struct {
	From       time.Time
	To         time.Time
	Days       int64
	Characters int64
	Ships      int64
	Targets    int64
}

Result describes a bounded reconciliation run.

func ProcessDirtyDay added in v0.1.41

func ProcessDirtyDay(ctx context.Context, pool *pgxpool.Pool, day time.Time) (Result, bool, error)

ProcessDirtyDay rebuilds one marked day. The marker timestamp is cleared conditionally, so a concurrent killmail that advances it remains dirty and is repaired again without making ingestion wait on the rebuild.

func Reconcile

func Reconcile(ctx context.Context, pool *pgxpool.Pool) (Result, error)

Reconcile refreshes recent days and bootstraps the full retention window on first use. Each day commits atomically so a timeout never exposes partial facts and the next run can resume from its coverage markers.

Jump to

Keyboard shortcuts

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