summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--modules/auth/sso/oauth2.go2
-rw-r--r--modules/indexer/stats/queue.go10
2 files changed, 9 insertions, 3 deletions
diff --git a/modules/auth/sso/oauth2.go b/modules/auth/sso/oauth2.go
index e677490b80..6860c12e39 100644
--- a/modules/auth/sso/oauth2.go
+++ b/modules/auth/sso/oauth2.go
@@ -93,7 +93,7 @@ func (o *OAuth2) userIDFromToken(ctx *macaron.Context) int64 {
}
t, err := models.GetAccessTokenBySHA(tokenSHA)
if err != nil {
- if models.IsErrAccessTokenNotExist(err) || models.IsErrAccessTokenEmpty(err) {
+ if !models.IsErrAccessTokenNotExist(err) && !models.IsErrAccessTokenEmpty(err) {
log.Error("GetAccessTokenBySHA: %v", err)
}
return 0
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
}