repeatlog

package
v0.327.0 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2026 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package repeatlog keeps a recurring log line from flooding the log: a line is logged the first time it is seen in a scope, and the same line in the same scope is not logged again until Every has passed since it last was — and then with the number of repeats not logged in between. A DIFFERENT line in the scope is logged at once, and Limiter.Reset (the outcome changed: an agent was moved, a pool got a worker) lets the next line of the scope through whatever it says.

Why

When every Claude account of an owner is cooling down, every pool submission and every failed turn asks the account failover again, and each logged the same "no other Claude account is usable" pair: ~46 lines a minute on a production deployment (2026-12-03), for days, until the weekly limit reset.

Index

Constants

View Source
const Every = 10 * time.Minute

Every is how long the same line in a scope stays unlogged.

Variables

This section is empty.

Functions

func Note

func Note(n int) string

Note is the suffix a logged line carries for n repeats not logged ("" for 0).

Types

type Limiter

type Limiter struct {
	// contains filtered or unexported fields
}

Limiter decides which lines are logged. The zero value is ready to use.

func (*Limiter) Allow

func (l *Limiter) Allow(scope, line string, now time.Time) (bool, int)

Allow reports whether line, in scope, is to be logged at now, and how many repeats of it were not logged since it last was (0 for a line not seen within Every).

func (*Limiter) Reset

func (l *Limiter) Reset(scope string)

Reset forgets scope: its next line is logged whatever it says.

Jump to

Keyboard shortcuts

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