Documentation
¶
Index ¶
- Constants
- Variables
- func EnqueueWithIgnore(ctx context.Context, req *pb.EnqueueRequest, ...) error
- type BackgroundRunner
- func (b *BackgroundRunner) AddFolder(ctx context.Context, folderName string, d discogs.Discogs, u *pb.StoredUser) error
- func (b *BackgroundRunner) AddMasterWant(ctx context.Context, d discogs.Discogs, want *pb.Want) error
- func (b *BackgroundRunner) AddSale(ctx context.Context, d discogs.Discogs, iid int64, saleParams *pbd.SaleParams, ...) error
- func (b *BackgroundRunner) AdjustSales(ctx context.Context, c *pb.SaleConfig, user *pb.StoredUser, ...) error
- func (b *BackgroundRunner) AlignDigitalWantlist(ctx context.Context, userid int32) error
- func (b *BackgroundRunner) AlignWants(ctx context.Context, user *pb.StoredUser, c *pb.WantsConfig) error
- func (b *BackgroundRunner) CleanCollection(ctx context.Context, d discogs.Discogs, refreshId int64, authToken string, ...) error
- func (b *BackgroundRunner) CleanSales(ctx context.Context, userid int32, refreshId int64) error
- func (b *BackgroundRunner) CullWants(ctx context.Context, d discogs.Discogs, sid int64) error
- func (b *BackgroundRunner) DeleteRecord(ctx context.Context, d discogs.Discogs, iid int64) error
- func (b *BackgroundRunner) Execute(ctx context.Context, d discogs.Discogs, u *pb.StoredUser, ...) error
- func (b *BackgroundRunner) FanoutHistory(ctx context.Context, typ pb.UpdateType, user *pb.StoredUser, auth string, ...) error
- func (b *BackgroundRunner) GetDeduplicationKey(entry *pb.QueueElement) string
- func (b *BackgroundRunner) GetFormat(ctx context.Context, record *pb.Record, fc *pb.FormatClassifier) string
- func (b *BackgroundRunner) HardLink(ctx context.Context, user *pb.StoredUser, records []*pb.Record, ...) error
- func (b *BackgroundRunner) LinkSales(ctx context.Context, user *pb.StoredUser) error
- func (b *BackgroundRunner) MoveRecord(ctx context.Context, d discogs.Discogs, u *pb.StoredUser, entry *pb.MoveRecord, ...) error
- func (b *BackgroundRunner) ProcessArrived(ctx context.Context, d discogs.Discogs, r *pb.Record, i *pb.Intent, ...) error
- func (b *BackgroundRunner) ProcessCollectionPage(ctx context.Context, d discogs.Discogs, page int32, refreshId int64) (int32, error)
- func (b *BackgroundRunner) ProcessGoalFolder(ctx context.Context, d discogs.Discogs, r *pb.Record, i *pb.Intent, ...) error
- func (b *BackgroundRunner) ProcessIntents(ctx context.Context, d discogs.Discogs, r *pb.Record, i *pb.Intent, ...) error
- func (b *BackgroundRunner) ProcessKeep(ctx context.Context, d discogs.Discogs, r *pb.Record, i *pb.Intent, ...) error
- func (b *BackgroundRunner) ProcessListenDate(ctx context.Context, d discogs.Discogs, r *pb.Record, i *pb.Intent, ...) error
- func (b *BackgroundRunner) ProcessPurchaseLocation(ctx context.Context, d discogs.Discogs, r *pb.Record, i *pb.Intent, ...) error
- func (b *BackgroundRunner) ProcessPurchasePrice(ctx context.Context, d discogs.Discogs, r *pb.Record, i *pb.Intent, ...) error
- func (b *BackgroundRunner) ProcessRefreshCollectionEntry(ctx context.Context, d discogs.Discogs, user *pb.StoredUser, ...) error
- func (b *BackgroundRunner) ProcessRefreshIntents(ctx context.Context, d discogs.Discogs, entry *pb.QueueElement, ...) error
- func (b *BackgroundRunner) ProcessRefreshRelease(ctx context.Context, u *pb.StoredUser, d discogs.Discogs, ...) error
- func (b *BackgroundRunner) ProcessRefreshSales(ctx context.Context, d discogs.Discogs, user *pb.StoredUser, ...) error
- func (b *BackgroundRunner) ProcessRefreshState(ctx context.Context, d discogs.Discogs, entry *pb.QueueElement, ...) error
- func (b *BackgroundRunner) ProcessRefreshWantlists(ctx context.Context, d discogs.Discogs, authToken string, ...) error
- func (b *BackgroundRunner) ProcessScore(ctx context.Context, d discogs.Discogs, r *pb.Record, i *pb.Intent, ...) error
- func (b *BackgroundRunner) ProcessSetClean(ctx context.Context, d discogs.Discogs, r *pb.Record, i *pb.Intent, ...) error
- func (b *BackgroundRunner) ProcessSetFolder(ctx context.Context, d discogs.Discogs, r *pb.Record, i *pb.Intent, ...) error
- func (b *BackgroundRunner) ProcessSetOversize(ctx context.Context, d discogs.Discogs, r *pb.Record, i *pb.Intent, ...) error
- func (b *BackgroundRunner) ProcessSetWeight(ctx context.Context, d discogs.Discogs, r *pb.Record, i *pb.Intent, ...) error
- func (b *BackgroundRunner) ProcessSetWidth(ctx context.Context, d discogs.Discogs, r *pb.Record, i *pb.Intent, ...) error
- func (b *BackgroundRunner) ProcessSleeve(ctx context.Context, d discogs.Discogs, r *pb.Record, i *pb.Intent, ...) error
- func (b *BackgroundRunner) ProcessSyncWants(ctx context.Context, d discogs.Discogs, user *pb.StoredUser, ...) error
- func (b *BackgroundRunner) ProcessUpdateSale(ctx context.Context, d discogs.Discogs, u *pb.StoredUser, entry *pb.UpdateSale) error
- func (b *BackgroundRunner) PullWants(ctx context.Context, d discogs.Discogs, page int32, sid int64, ...) (int32, error)
- func (b *BackgroundRunner) PurgeDigitalwantlist(ctx context.Context, user *pb.StoredUser, userid int32) (*pb.Wantlist, error)
- func (b *BackgroundRunner) RecordHistory(ctx context.Context, typ pb.UpdateType, userid, iid int64) error
- func (b *BackgroundRunner) RefreshCollection(ctx context.Context, d discogs.Discogs, authToken string, ...) error
- func (b *BackgroundRunner) RefreshRelease(ctx context.Context, iid int64, u *pb.StoredUser, d discogs.Discogs, ...) error
- func (b *BackgroundRunner) RefreshReleaseDate(ctx context.Context, u *pb.StoredUser, d discogs.Discogs, digWants bool, ...) error
- func (b *BackgroundRunner) RefreshReleaseDates(ctx context.Context, d discogs.Discogs, token string, iid, mid int64, ...) error
- func (b *BackgroundRunner) RefreshState(ctx context.Context, iid int64, d discogs.Discogs, force bool) error
- func (b *BackgroundRunner) RefreshUser(ctx context.Context, d discogs.Discogs, utoken string, ...) error
- func (b *BackgroundRunner) RefreshWant(ctx context.Context, d discogs.Discogs, want *pb.Want, authToken string, ...) error
- func (b *BackgroundRunner) RefreshWantInternal(ctx context.Context, d discogs.Discogs, want *pb.Want, authToken string, ...) (bool, error)
- func (b *BackgroundRunner) RefreshWantlists(ctx context.Context, d discogs.Discogs, authToken string, ...) error
- func (b *BackgroundRunner) RefreshWants(ctx context.Context, d discogs.Discogs, auth string, ...) error
- func (b *BackgroundRunner) RegisterAllHandlers()
- func (b *BackgroundRunner) RegisterTaskHandler(entryType string, handler TaskHandler)
- func (b *BackgroundRunner) RunMoves(ctx context.Context, user *pb.StoredUser, ...) error
- func (b *BackgroundRunner) SyncSales(ctx context.Context, d discogs.Discogs, page int32, id int64) (*pbd.Pagination, error)
- func (b *BackgroundRunner) UpdateSalePrice(ctx context.Context, d discogs.Discogs, sid int64, releaseid int64, ...) error
- func (b *BackgroundRunner) Validate(ctx context.Context, entry *pb.QueueElement) error
- type TaskHandler
Constants ¶
View Source
const ( RefreshReleasePeriod = time.Hour * 24 * 7 // Once a week RefreshReleaseDatesPeriod = time.Hour * 24 * 7 * 30 // Once a month )
Variables ¶
View Source
var ( Intention = promauto.NewCounterVec(prometheus.CounterOpts{ Name: "gramophile_intention", Help: "The length of the working queue I think yes", }, []string{"intention"}) MarkerCount = promauto.NewCounter(prometheus.CounterOpts{ Name: "gramophile_marker_rejects", Help: "The length of the working queue I think yes", }) Rintention = promauto.NewCounterVec(prometheus.CounterOpts{ Name: "gramophile_queue_refresh_intention", Help: "The length of the working queue I think yes", }, []string{"intention"}) TaskDuration = promauto.NewSummaryVec(prometheus.SummaryOpts{ Name: "gramophile_task_duration", Help: "Duration of background tasks", }, []string{"type"}) TaskResult = promauto.NewCounterVec(prometheus.CounterOpts{ Name: "gramophile_task_result", Help: "Result of background tasks", }, []string{"type", "result"}) )
Functions ¶
func EnqueueWithIgnore ¶ added in v0.1441.0
func EnqueueWithIgnore(ctx context.Context, req *pb.EnqueueRequest, enqueue func(context.Context, *pb.EnqueueRequest) (*pb.EnqueueResponse, error)) error
Types ¶
type BackgroundRunner ¶
type BackgroundRunner struct {
ReleaseRefresh int64
// contains filtered or unexported fields
}
func GetBackgroundRunner ¶ added in v0.67.0
func GetBackgroundRunner(db db.Database, key, secret, callback string) *BackgroundRunner
func (*BackgroundRunner) AddFolder ¶ added in v0.297.0
func (b *BackgroundRunner) AddFolder(ctx context.Context, folderName string, d discogs.Discogs, u *pb.StoredUser) error
func (*BackgroundRunner) AddMasterWant ¶ added in v0.667.0
func (*BackgroundRunner) AddSale ¶ added in v0.1186.0
func (b *BackgroundRunner) AddSale(ctx context.Context, d discogs.Discogs, iid int64, saleParams *pbd.SaleParams, user *pb.StoredUser) error
func (*BackgroundRunner) AdjustSales ¶ added in v0.317.0
func (b *BackgroundRunner) AdjustSales(ctx context.Context, c *pb.SaleConfig, user *pb.StoredUser, enqueue func(context.Context, *pb.EnqueueRequest) (*pb.EnqueueResponse, error)) error
func (*BackgroundRunner) AlignDigitalWantlist ¶ added in v0.1306.0
func (b *BackgroundRunner) AlignDigitalWantlist(ctx context.Context, userid int32) error
func (*BackgroundRunner) AlignWants ¶ added in v0.606.0
func (b *BackgroundRunner) AlignWants(ctx context.Context, user *pb.StoredUser, c *pb.WantsConfig) error
Ensures everything is in a wantlist - only used when ORIGIN_GRAMOPHILE is set for wants
func (*BackgroundRunner) CleanCollection ¶ added in v0.249.0
func (b *BackgroundRunner) CleanCollection(ctx context.Context, d discogs.Discogs, refreshId int64, authToken string, enqueue func(context.Context, *pb.EnqueueRequest) (*pb.EnqueueResponse, error)) error
func (*BackgroundRunner) CleanSales ¶ added in v0.550.0
func (*BackgroundRunner) DeleteRecord ¶ added in v0.1420.0
func (*BackgroundRunner) Execute ¶ added in v0.1432.0
func (b *BackgroundRunner) Execute(ctx context.Context, d discogs.Discogs, u *pb.StoredUser, entry *pb.QueueElement, enqueue func(context.Context, *pb.EnqueueRequest) (*pb.EnqueueResponse, error)) error
func (*BackgroundRunner) FanoutHistory ¶ added in v0.1146.0
func (b *BackgroundRunner) FanoutHistory(ctx context.Context, typ pb.UpdateType, user *pb.StoredUser, auth string, enqueue func(context.Context, *pb.EnqueueRequest) (*pb.EnqueueResponse, error)) error
func (*BackgroundRunner) GetDeduplicationKey ¶ added in v0.1432.0
func (b *BackgroundRunner) GetDeduplicationKey(entry *pb.QueueElement) string
func (*BackgroundRunner) GetFormat ¶ added in v0.1133.0
func (b *BackgroundRunner) GetFormat(ctx context.Context, record *pb.Record, fc *pb.FormatClassifier) string
func (*BackgroundRunner) HardLink ¶ added in v0.300.0
func (b *BackgroundRunner) HardLink(ctx context.Context, user *pb.StoredUser, records []*pb.Record, sales []*pb.SaleInfo) error
func (*BackgroundRunner) LinkSales ¶ added in v0.300.0
func (b *BackgroundRunner) LinkSales(ctx context.Context, user *pb.StoredUser) error
func (*BackgroundRunner) MoveRecord ¶ added in v0.1424.0
func (b *BackgroundRunner) MoveRecord(ctx context.Context, d discogs.Discogs, u *pb.StoredUser, entry *pb.MoveRecord, auth string, enqueue func(context.Context, *pb.EnqueueRequest) (*pb.EnqueueResponse, error)) error
func (*BackgroundRunner) ProcessArrived ¶ added in v0.276.0
func (*BackgroundRunner) ProcessCollectionPage ¶ added in v0.67.0
func (*BackgroundRunner) ProcessGoalFolder ¶ added in v0.252.0
func (*BackgroundRunner) ProcessIntents ¶ added in v0.119.0
func (*BackgroundRunner) ProcessKeep ¶ added in v0.297.0
func (*BackgroundRunner) ProcessListenDate ¶ added in v0.191.0
func (*BackgroundRunner) ProcessPurchaseLocation ¶ added in v0.1147.0
func (*BackgroundRunner) ProcessPurchasePrice ¶ added in v0.1147.0
func (*BackgroundRunner) ProcessRefreshCollectionEntry ¶ added in v0.1424.0
func (b *BackgroundRunner) ProcessRefreshCollectionEntry(ctx context.Context, d discogs.Discogs, user *pb.StoredUser, entry *pb.QueueElement, enqueue func(context.Context, *pb.EnqueueRequest) (*pb.EnqueueResponse, error)) error
func (*BackgroundRunner) ProcessRefreshIntents ¶ added in v0.1424.0
func (b *BackgroundRunner) ProcessRefreshIntents(ctx context.Context, d discogs.Discogs, entry *pb.QueueElement, enqueue func(ctx context.Context, entry *pb.EnqueueRequest) (*pb.EnqueueResponse, error)) error
func (*BackgroundRunner) ProcessRefreshRelease ¶ added in v0.1424.0
func (b *BackgroundRunner) ProcessRefreshRelease(ctx context.Context, u *pb.StoredUser, d discogs.Discogs, entry *pb.QueueElement, enqueue func(context.Context, *pb.EnqueueRequest) (*pb.EnqueueResponse, error)) error
func (*BackgroundRunner) ProcessRefreshSales ¶ added in v0.1424.0
func (b *BackgroundRunner) ProcessRefreshSales(ctx context.Context, d discogs.Discogs, user *pb.StoredUser, entry *pb.QueueElement, enqueue func(context.Context, *pb.EnqueueRequest) (*pb.EnqueueResponse, error)) error
func (*BackgroundRunner) ProcessRefreshState ¶ added in v0.1424.0
func (b *BackgroundRunner) ProcessRefreshState(ctx context.Context, d discogs.Discogs, entry *pb.QueueElement, enqueue func(context.Context, *pb.EnqueueRequest) (*pb.EnqueueResponse, error)) error
func (*BackgroundRunner) ProcessRefreshWantlists ¶ added in v0.1424.0
func (b *BackgroundRunner) ProcessRefreshWantlists(ctx context.Context, d discogs.Discogs, authToken string, enqueue func(context.Context, *pb.EnqueueRequest) (*pb.EnqueueResponse, error)) error
func (*BackgroundRunner) ProcessScore ¶ added in v0.380.0
func (*BackgroundRunner) ProcessSetClean ¶ added in v0.119.0
func (*BackgroundRunner) ProcessSetFolder ¶ added in v0.817.0
func (*BackgroundRunner) ProcessSetOversize ¶ added in v0.1126.0
func (*BackgroundRunner) ProcessSetWeight ¶ added in v0.241.0
func (*BackgroundRunner) ProcessSetWidth ¶ added in v0.215.0
func (*BackgroundRunner) ProcessSleeve ¶ added in v0.274.0
func (*BackgroundRunner) ProcessSyncWants ¶ added in v0.1424.0
func (b *BackgroundRunner) ProcessSyncWants(ctx context.Context, d discogs.Discogs, user *pb.StoredUser, entry *pb.QueueElement, enqueue func(context.Context, *pb.EnqueueRequest) (*pb.EnqueueResponse, error)) error
func (*BackgroundRunner) ProcessUpdateSale ¶ added in v0.1424.0
func (b *BackgroundRunner) ProcessUpdateSale(ctx context.Context, d discogs.Discogs, u *pb.StoredUser, entry *pb.UpdateSale) error
func (*BackgroundRunner) PurgeDigitalwantlist ¶ added in v0.1271.0
func (b *BackgroundRunner) PurgeDigitalwantlist(ctx context.Context, user *pb.StoredUser, userid int32) (*pb.Wantlist, error)
func (*BackgroundRunner) RecordHistory ¶ added in v0.1146.0
func (b *BackgroundRunner) RecordHistory(ctx context.Context, typ pb.UpdateType, userid, iid int64) error
func (*BackgroundRunner) RefreshCollection ¶ added in v0.421.0
func (b *BackgroundRunner) RefreshCollection(ctx context.Context, d discogs.Discogs, authToken string, enqueue func(context.Context, *pb.EnqueueRequest) (*pb.EnqueueResponse, error)) error
func (*BackgroundRunner) RefreshRelease ¶ added in v0.421.0
func (b *BackgroundRunner) RefreshRelease(ctx context.Context, iid int64, u *pb.StoredUser, d discogs.Discogs, force bool) error
func (*BackgroundRunner) RefreshReleaseDate ¶ added in v0.446.0
func (b *BackgroundRunner) RefreshReleaseDate(ctx context.Context, u *pb.StoredUser, d discogs.Discogs, digWants bool, iid, rid int64, token string, enqueue func(context.Context, *pb.EnqueueRequest) (*pb.EnqueueResponse, error)) error
func (*BackgroundRunner) RefreshReleaseDates ¶ added in v0.446.0
func (*BackgroundRunner) RefreshState ¶ added in v0.775.0
func (*BackgroundRunner) RefreshUser ¶
func (b *BackgroundRunner) RefreshUser(ctx context.Context, d discogs.Discogs, utoken string, enqueue func(context.Context, *pb.EnqueueRequest) (*pb.EnqueueResponse, error)) error
func (*BackgroundRunner) RefreshWant ¶ added in v0.467.0
func (*BackgroundRunner) RefreshWantInternal ¶ added in v0.852.0
func (*BackgroundRunner) RefreshWantlists ¶ added in v0.304.0
func (b *BackgroundRunner) RefreshWantlists(ctx context.Context, d discogs.Discogs, authToken string, enqueue func(context.Context, *pb.EnqueueRequest) (*pb.EnqueueResponse, error)) error
func (*BackgroundRunner) RefreshWants ¶ added in v0.467.0
func (b *BackgroundRunner) RefreshWants(ctx context.Context, d discogs.Discogs, auth string, enqueue func(ctx context.Context, req *pb.EnqueueRequest) (*pb.EnqueueResponse, error)) error
func (*BackgroundRunner) RegisterAllHandlers ¶ added in v0.1432.0
func (b *BackgroundRunner) RegisterAllHandlers()
func (*BackgroundRunner) RegisterTaskHandler ¶ added in v0.1432.0
func (b *BackgroundRunner) RegisterTaskHandler(entryType string, handler TaskHandler)
func (*BackgroundRunner) RunMoves ¶ added in v0.318.0
func (b *BackgroundRunner) RunMoves(ctx context.Context, user *pb.StoredUser, enqueue func(context.Context, *pb.EnqueueRequest) (*pb.EnqueueResponse, error)) error
func (*BackgroundRunner) SyncSales ¶ added in v0.300.0
func (b *BackgroundRunner) SyncSales(ctx context.Context, d discogs.Discogs, page int32, id int64) (*pbd.Pagination, error)
func (*BackgroundRunner) UpdateSalePrice ¶ added in v0.317.0
func (*BackgroundRunner) Validate ¶ added in v0.1432.0
func (b *BackgroundRunner) Validate(ctx context.Context, entry *pb.QueueElement) error
type TaskHandler ¶ added in v0.1432.0
type TaskHandler interface {
Execute(ctx context.Context, d discogs.Discogs, u *pb.StoredUser, entry *pb.QueueElement, enqueue func(context.Context, *pb.EnqueueRequest) (*pb.EnqueueResponse, error)) error
Validate(ctx context.Context, db db.Database, entry *pb.QueueElement) error
GetDeduplicationKey(entry *pb.QueueElement) string
}
Click to show internal directories.
Click to hide internal directories.