summaryrefslogtreecommitdiffstats
path: root/modules/indexer
diff options
context:
space:
mode:
authorLauris BH <lauris@nix.lv>2020-02-14 14:42:30 +0200
committerGitHub <noreply@github.com>2020-02-14 13:42:30 +0100
commita1d796f521919e653f5ceb64d7d361a64cc0139f (patch)
treeee77601af4b21809317b930f5c7232ac52f2a638 /modules/indexer
parentff261dafc4845941756a2421acec265663b94e5e (diff)
downloadgitea-a1d796f521919e653f5ceb64d7d361a64cc0139f.tar.gz
gitea-a1d796f521919e653f5ceb64d7d361a64cc0139f.zip
Index code and stats only for non-empty repositories (#10251)
Fix test and switch to unique queue Fix MySQL support when deleting old statistics
Diffstat (limited to 'modules/indexer')
-rw-r--r--modules/indexer/stats/queue.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/indexer/stats/queue.go b/modules/indexer/stats/queue.go
index 43a4de5ac9..9c83f9b412 100644
--- a/modules/indexer/stats/queue.go
+++ b/modules/indexer/stats/queue.go
@@ -14,7 +14,7 @@ import (
)
// statsQueue represents a queue to handle repository stats updates
-var statsQueue queue.Queue
+var statsQueue queue.UniqueQueue
// handle passed PR IDs and test the PRs
func handle(data ...queue.Data) {
@@ -27,7 +27,7 @@ func handle(data ...queue.Data) {
}
func initStatsQueue() error {
- statsQueue = queue.CreateQueue("repo_stats_update", handle, int64(0)).(queue.Queue)
+ statsQueue = queue.CreateUniqueQueue("repo_stats_update", handle, int64(0)).(queue.UniqueQueue)
if statsQueue == nil {
return fmt.Errorf("Unable to create repo_stats_update Queue")
}