backend

package
v0.0.0-...-e560ebb Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: BSD-3-Clause Imports: 34 Imported by: 0

Documentation

Overview

Package backend implements the core logic of Arquebus service.

Index

Constants

View Source
const (
	// OptOutLabel stops Arquebus updating the issue, if added.
	OptOutLabel = "Arquebus-Opt-Out"
	// IssueUpdateMaxConcurrency is the maximum number of
	// monorail.UpdateIssue()s that can be invoked in parallel.
	IssueUpdateMaxConcurrency = 4
)

Variables

View Source
var File_infra_appengine_arquebus_app_backend_tq_proto protoreflect.FileDescriptor

Functions

func GetAllAssigners

func GetAllAssigners(c context.Context) ([]*model.Assigner, error)

GetAllAssigners returns all assigners.

func GetAssigner

func GetAssigner(c context.Context, aid string) (*model.Assigner, error)

GetAssigner returns the Assigner matching with a given ID.

func GetAssignerWithTasks

func GetAssignerWithTasks(c context.Context, assignerID string, limit int32, includeNoopSuccess bool) (assigner *model.Assigner, tasks []*model.Task, err error)

GetAssignerWithTasks returns up to |limit| of Task entities for the Assigner in ExpectedStart desc order.

If includeNoopSuccess is true, the return includes the Task entities that were completed successfully without issue updates.

func GetTask

func GetTask(c context.Context, assignerID string, taskID int64) (*model.Assigner, *model.Task, error)

GetTask returns the task entity matching with the assigner and task IDs.

func InstallHandlers

func InstallHandlers(r *router.Router, dispatcher *tq.Dispatcher, m router.MiddlewareChain)

InstallHandlers installs TaskQueue handlers into a given task queue.

func RemoveNoopTasks

func RemoveNoopTasks(c context.Context, ae *model.Assigner, n int32) error

RemoveNoopTasks removes a given number of noop tasks.

TODO(crbug.com/967525): remove this once all the existing noop task entities are cleared out.

func UpdateAssigners

func UpdateAssigners(c context.Context, cfgs []*config.Assigner, rev string) error

UpdateAssigners updates all the Assigner entities, based on the configs, and remove the assigners of which configs no longer exist.

Types

type RunAssignerTask

type RunAssignerTask struct {
	AssignerId string `protobuf:"bytes,1,opt,name=assigner_id,json=assignerId,proto3" json:"assigner_id,omitempty"`
	// the task ID of a scheduled tasks to trigger a run.
	TaskId int64 `protobuf:"varint,2,opt,name=task_id,json=taskId,proto3" json:"task_id,omitempty"`
	// contains filtered or unexported fields
}

RunAssignerTask is to trigger an assigner run for a given scheduled task.

Queue: "run-assigners".

func (*RunAssignerTask) Descriptor deprecated

func (*RunAssignerTask) Descriptor() ([]byte, []int)

Deprecated: Use RunAssignerTask.ProtoReflect.Descriptor instead.

func (*RunAssignerTask) GetAssignerId

func (x *RunAssignerTask) GetAssignerId() string

func (*RunAssignerTask) GetTaskId

func (x *RunAssignerTask) GetTaskId() int64

func (*RunAssignerTask) ProtoMessage

func (*RunAssignerTask) ProtoMessage()

func (*RunAssignerTask) ProtoReflect

func (x *RunAssignerTask) ProtoReflect() protoreflect.Message

func (*RunAssignerTask) Reset

func (x *RunAssignerTask) Reset()

func (*RunAssignerTask) String

func (x *RunAssignerTask) String() string

type ScheduleAssignerTask

type ScheduleAssignerTask struct {
	AssignerId string `protobuf:"bytes,1,opt,name=assigner_id,json=assignerId,proto3" json:"assigner_id,omitempty"`
	// contains filtered or unexported fields
}

ScheduleAssignerTask is to schedule a new task for a given assigner.

Queue: "schedule-assigners".

func (*ScheduleAssignerTask) Descriptor deprecated

func (*ScheduleAssignerTask) Descriptor() ([]byte, []int)

Deprecated: Use ScheduleAssignerTask.ProtoReflect.Descriptor instead.

func (*ScheduleAssignerTask) GetAssignerId

func (x *ScheduleAssignerTask) GetAssignerId() string

func (*ScheduleAssignerTask) ProtoMessage

func (*ScheduleAssignerTask) ProtoMessage()

func (*ScheduleAssignerTask) ProtoReflect

func (x *ScheduleAssignerTask) ProtoReflect() protoreflect.Message

func (*ScheduleAssignerTask) Reset

func (x *ScheduleAssignerTask) Reset()

func (*ScheduleAssignerTask) String

func (x *ScheduleAssignerTask) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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