Documentation ¶
Overview ¶
Package criercommonlib contains shared lib used by reporters
Package criercommonlib contains shared lib used by reporters ¶
Package criercommonlib contains shared lib used by reporters
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsUserError ¶
IsUserError checks whether the returned error is a user error.
Types ¶
type ShardedLock ¶
type ShardedLock struct {
// contains filtered or unexported fields
}
ShardedLock contains sharding information based on PRs
func (*ShardedLock) Cleanup ¶
func (s *ShardedLock) Cleanup()
Cleanup deletes all locks by acquiring first the mapLock and then each individual lock before deleting it. The individual lock must be acquired because otherwise it may be held, we delete it from the map, it gets recreated and acquired and two routines report in parallel for the same job. Note that while this function is running, no new presubmit reporting can happen, as we hold the mapLock.
func (*ShardedLock) GetLock ¶
func (s *ShardedLock) GetLock(ctx context.Context, key SimplePull) (*semaphore.Weighted, error)
GetLock acquires the lock for a PR
func (*ShardedLock) RunCleanup ¶
func (s *ShardedLock) RunCleanup()
RunCleanup asynchronously runs the cleanup once per hour.
type SimplePull ¶
type SimplePull struct {
// contains filtered or unexported fields
}
SimplePull contains info for identifying a shard
func NewSimplePull ¶
func NewSimplePull(org, repo string, number int) *SimplePull
NewSimplePull creates SimplePull