dbcleanup

package
v0.0.0-...-c85edb6 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2019 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package dbcleanup defines the life cycle and logic of beacon DB cleanup routine.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CleanupService

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

CleanupService represents a service that handles routine task for cleaning up beacon DB so our DB won't grow infinitely. Currently it only cleans up block vote cache. In future, it could add more tasks such as cleaning up historical beacon states.

func NewCleanupService

func NewCleanupService(ctx context.Context, cfg *Config) *CleanupService

NewCleanupService creates a new cleanup service instance.

func (*CleanupService) Start

func (d *CleanupService) Start()

Start a cleanup service.

func (*CleanupService) Status

func (d *CleanupService) Status() error

Status always returns nil. TODO(1203): Add service health checks.

func (*CleanupService) Stop

func (d *CleanupService) Stop() error

Stop a cleanup service.

type Config

type Config struct {
	SubscriptionBuf int
	BeaconDB        *db.BeaconDB
	ChainService    chainService
}

Config defines the needed fields for creating a new cleanup service.

Jump to

Keyboard shortcuts

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