From bac65f1b826be84d132420f1acd3a384dd3a8db8 Mon Sep 17 00:00:00 2001 From: zeripath Date: Sat, 1 Aug 2020 15:45:26 +0100 Subject: Fix incorrect error logging in Stats indexer and OAuth2 (#12387) * Fix incorrect logging in oauth2.go Fix #11945 Signed-off-by: Andrew Thornton * Handle ErrAlreadyInQueue in stats indexer Fix #12380 Signed-off-by: Andrew Thornton * Fixes type in error message of indexer Add the missing character in the error message. Co-authored-by: techknowlogick Co-authored-by: Lieven Hollevoet --- modules/indexer/stats/queue.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'modules/indexer') diff --git a/modules/indexer/stats/queue.go b/modules/indexer/stats/queue.go index 9c83f9b412..8309cfcd3b 100644 --- a/modules/indexer/stats/queue.go +++ b/modules/indexer/stats/queue.go @@ -21,7 +21,7 @@ func handle(data ...queue.Data) { for _, datum := range data { opts := datum.(int64) if err := indexer.Index(opts); err != nil { - log.Error("stats queue idexer.Index(%d) failed: %v", opts, err) + log.Error("stats queue indexer.Index(%d) failed: %v", opts, err) } } } @@ -39,5 +39,11 @@ func initStatsQueue() error { // UpdateRepoIndexer update a repository's entries in the indexer func UpdateRepoIndexer(repo *models.Repository) error { - return statsQueue.Push(repo.ID) + if err := statsQueue.Push(repo.ID); err != nil { + if err != queue.ErrAlreadyInQueue { + return err + } + log.Debug("Repo ID: %d already queued", repo.ID) + } + return nil } -- cgit v1.2.3