tjupdate

package
v0.0.0-...-730e7e1 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package tjupdate contains Updater, which handles an UpdateTryjobTask.

This involves updating a Tryjob by querying the backend system, and updating Tryjob entities in Datastore.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Updater

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

Updater knows how to update Tryjobs, notifying other CV parts as needed.

func NewUpdater

func NewUpdater(env *common.Env, tn *tryjob.Notifier, rm rmNotifier) *Updater

NewUpdater creates a new Updater.

Starts without backends, but they should be added via RegisterBackend().

func (*Updater) RegisterBackend

func (u *Updater) RegisterBackend(b updaterBackend)

RegisterBackend registers a backend.

Panics if backend for the same kind is already registered.

func (*Updater) Update

func (u *Updater) Update(ctx context.Context, eid tryjob.ExternalID, data any) error

Update updates the Tryjob entity associated with the given `eid`.

`data` should contain the latest information of the Tryjob from the Tryjob backend system (e.g. Build proto from Buildbucket pubsub).

No-op if the Tryjob data stored in CV appears to be newer than the provided data (e.g. has newer Tryjob.Result.UpdateTime)

Jump to

Keyboard shortcuts

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