reportedrollup

package
v0.33.5-rc-monkit Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2020 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// Error is the error class for this package
	Error = errs.Class("reportedrollup")
)

Functions

This section is empty.

Types

type Chore

type Chore struct {
	Loop *sync2.Cycle
	// contains filtered or unexported fields
}

Chore for flushing reported serials to the database as rollups.

architecture: Chore

func NewChore

func NewChore(log *zap.Logger, db orders.DB, config Config) *Chore

NewChore creates new chore for flushing the reported serials to the database as rollups.

func (*Chore) Close

func (chore *Chore) Close() error

Close stops the reported rollups chore.

func (*Chore) Run

func (chore *Chore) Run(ctx context.Context) (err error)

Run starts the reported rollups chore.

func (*Chore) RunOnce

func (chore *Chore) RunOnce(ctx context.Context, now time.Time) (err error)

RunOnce finds expired bandwidth as of 'now' and inserts rollups into the appropriate tables.

type Config

type Config struct {
	Interval time.Duration `help:"how often to flush the reported serial rollups to the database" devDefault:"5m" releaseDefault:"24h"`
}

Config is a configuration struct for the Chore.

Jump to

Keyboard shortcuts

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