sync

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2026 License: 0BSD Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSyncInProgress = errors.New("sync already in progress")

ErrSyncInProgress is returned by SyncNow when a drain is already running. It signals that the call did no work (issued no request), so callers can treat it as a no-op rather than a real sync attempt.

Functions

This section is empty.

Types

type Syncer

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

func NewSyncer

func NewSyncer(database *db.DB, serverURL, apiToken string, intervalMinutes, batchSize int, metricsOnly bool) *Syncer

func (*Syncer) Start

func (s *Syncer) Start()

func (*Syncer) Stop

func (s *Syncer) Stop()

Stop signals the syncer to stop and blocks until the Start goroutine has finished its final drain, so callers may safely close the DB afterwards. It is safe to call more than once.

func (*Syncer) SyncNow

func (s *Syncer) SyncNow() error

SyncNow performs a single, non-retrying drain of the backlog and returns the real error so the socket caller learns whether the sync actually succeeded. It does not block on backoff or behind an in-progress drain.

Jump to

Keyboard shortcuts

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