jobs

package
v0.0.0-...-8d9ef14 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyGitListRepoFromOrg        = "git_list_repo_from_org"
	KeyGitGetDependenciesPrepend = "git_get_dependencies_"
)
View Source
const (
	KeyGitGetDependenciesGo = "git_get_dependencies_go"
)
View Source
const (
	KeyGitListContributorFromRepo = "git_list_contributor_from_repo"
)
View Source
const (
	KeyGitScoreContributor = "git_score_contributor"
)
View Source
const (
	KeyGitScoreRepository = "git_score_repository"
)

Variables

View Source
var (
	ErrImmediateReschedule = errors.New("commit tx, and reschedule ASAP")
	ErrDidNotReschedule    = errors.New("no need to reschedule, we are done")
)

Functions

func GitGetDependenciesGo

func GitGetDependenciesGo(qc *que.Client, logger *log.Logger, job *que.Job, tx *pgx.Tx) error

GetDependenciesGo : A jobfunc to retrieve list of dependencies and sort out ones on github so we can queue more jobs for rating

func GitListContributorFromRepo

func GitListContributorFromRepo(qc *que.Client, logger *log.Logger, job *que.Job, tx *pgx.Tx) error

GitListContributorFromRepo is a jobfunc to acquire the list of contributors from a repository.

func GitListRepoFromOrg

func GitListRepoFromOrg(qc *que.Client, logger *log.Logger, job *que.Job, tx *pgx.Tx) error

func GitScoreContributor

func GitScoreContributor(qc *que.Client, logger *log.Logger, job *que.Job, tx *pgx.Tx) error

func GitScoreRepository

func GitScoreRepository(qc *que.Client, logger *log.Logger, job *que.Job, tx *pgx.Tx) error

GitScoreRepository: Our scoring function

Types

type Contributor

type Contributor struct {
	C      *github.Contributor
	RepoID int
	Score  int
}

type GitOrg

type GitOrg struct {
	Name string
}

type JobFunc

type JobFunc func(qc *que.Client, logger *log.Logger, job *que.Job, tx *pgx.Tx) error

JobFunc should do a thing. Return either: nil => wrapper will schedule the next cron (if a cron), then commit the tx. ErrImmediateReschedule => wrapper will commit the tx, then try it again immediately. ErrDidNotReschedule => wrapper will rollback the tx, and if a cron, will not reschedule or retry. any other error => wrapper rollback the tx, and allow que to reschedule

type JobFuncWrapper

type JobFuncWrapper struct {
	QC        *que.Client
	Logger    *log.Logger
	F         JobFunc
	Singleton bool
	Duration  time.Duration
}

func (*JobFuncWrapper) Run

func (scw *JobFuncWrapper) Run(job *que.Job) error

type Repository

type Repository struct {
	R        *github.Repository
	OrgID    int
	ParentID int
	Score    int
}

Jump to

Keyboard shortcuts

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