summaryrefslogtreecommitdiffstats
path: root/modules/indexer/internal
diff options
context:
space:
mode:
authorJason Song <i@wolfogre.com>2023-06-23 22:39:52 +0800
committerGitHub <noreply@github.com>2023-06-23 14:39:52 +0000
commit3c7f5ed7b5bff347198cbb26492e6354ea42733b (patch)
treebc8bec6875162291f161fd1b49205bfbce54f09a /modules/indexer/internal
parente441a5d75143031661a3ffa26d4d6c8680e7f73f (diff)
downloadgitea-3c7f5ed7b5bff347198cbb26492e6354ea42733b.tar.gz
gitea-3c7f5ed7b5bff347198cbb26492e6354ea42733b.zip
Fix `Init` of db indexer (#25470)
Fix regression of #25174. The `Init` of the db indexer should return true to indicate that the index was opened/existed, or the indexer will try to populate the index (not really populate, just fill the queue, `Index` method of the db indexer is a dummy).
Diffstat (limited to 'modules/indexer/internal')
-rw-r--r--modules/indexer/internal/db/indexer.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/indexer/internal/db/indexer.go b/modules/indexer/internal/db/indexer.go
index 3f7e00efbb..3deec836c4 100644
--- a/modules/indexer/internal/db/indexer.go
+++ b/modules/indexer/internal/db/indexer.go
@@ -16,8 +16,9 @@ type Indexer struct{}
// Init initializes the indexer
func (i *Indexer) Init(_ context.Context) (bool, error) {
- // nothing to do
- return false, nil
+ // Return true to indicate that the index was opened/existed.
+ // So that the indexer will not try to populate the index, the data is already there.
+ return true, nil
}
// Ping checks if the indexer is available