1
0
Fork 0
forked from forgejo/forgejo

Index code and stats only for non-empty repositories (#10251)

Fix test and switch to unique queue

Fix MySQL support when deleting old statistics
This commit is contained in:
Lauris BH 2020-02-14 14:42:30 +02:00 committed by GitHub
parent ff261dafc4
commit a1d796f521
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 7 deletions

View file

@ -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")
}