tracker

package
v2.6.18 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// CheckInterval is the frequency in which new ready-to-check
	// tracked jobs are queried.
	CheckInterval = time.Second * 15
)

Functions

This section is empty.

Types

type Tracker

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

Tracker tracks Powergate jobs to their final status. Tracked jobs corresponds to Archives or Retrievals. Depending of the case, is what logic is applied when the Job reach a final status.

func New

func New(
	colls *mdb.Collections,
	buckets *tdb.Buckets,
	pgClient *powc.Client,
	internalSession string,
	jobPollIntervalSlow time.Duration,
	jobPollIntervalFast time.Duration,
	jfe chan<- archive.JobEvent,
) (*Tracker, error)

New returns a *Tracker.

func (*Tracker) Close

func (t *Tracker) Close() error

Close closes the module gracefully.

func (*Tracker) TrackArchive

func (t *Tracker) TrackArchive(
	ctx context.Context,
	dbID thread.ID,
	dbToken thread.Token,
	bucketKey string,
	jid string,
	bucketRoot cid.Cid,
	owner thread.PubKey,
) error

TrackArchive registers a new tracking for a Job, which corresponds to an bucket Archive action.

func (*Tracker) TrackRetrieval

func (t *Tracker) TrackRetrieval(ctx context.Context, accKey, jobID, powToken string) error

TrackRetrieval registers a new tracking for a Job, which corresponds to a Retrieval.

Jump to

Keyboard shortcuts

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