intelrollup

package
v0.1.81 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 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
)

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.

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