topicrankservice

package
v0.2.76 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Backfill

func Backfill(ctx context.Context) error

Backfill is a one-time versioned migration, never a periodic table scan.

func Rebuild

func Rebuild(ctx context.Context, progress func(int64)) (int64, error)

Rebuild explicitly visits a bounded snapshot of all topic IDs, including dormant topics. It preserves first publication timestamps and supports reruns.

func Recalculate

func Recalculate(ctx context.Context, id uint64, now time.Time) error

Recalculate is the explicit rebuild entry point. Normal worker processing already has the task version and goes straight to recalculateScheduled.

func Score

func Score(s Signals, published, now time.Time) (int64, *time.Time)

Score performs fixed-cost integer arithmetic over one topic's saved values.

func StartWorker

func StartWorker()

StartWorker runs at most once in this process. Shared-database deployments must enable it on only one instance; it does not acquire distributed leases.

Types

type Signals

type Signals struct {
	Likes, Replies uint64
	LastPostedAt   *time.Time
}

Signals contains only counters and timestamps already persisted on topics.

Jump to

Keyboard shortcuts

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