mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-11 15:04:02 +09:00
Wrap the code indexer (#9476)
* Wrap the code indexer In order to prevent a data race in the code indexer it must be wrapped with a holder otherwise it is possible to Search/Index on an incompletely initialised indexer, and search will fail with a nil pointer until the repository indexer is initialised. Further a completely initialised repository indexer should not be closed until Termination otherwise actions in Hammer/Shutdown phases could block or be lost. Finally, there is a complex dance of shutdown etiquette should the index initialisation fail. This PR restores that. * Always return err if closed whilst waiting Co-authored-by: techknowlogick <matti@mdranta.net>
This commit is contained in:
1 parent
34688e1db3
commit
30181d459d
3 files changed
+132
-13
No files matched your search
@@ -22,8 +22,6 @@ type repoIndexerOperation struct {
|
||||
var repoIndexerOperationQueue chan repoIndexerOperation
|
||||
|
||||
func processRepoIndexerOperationQueue(indexer Indexer) {
|
||||
defer indexer.Close()
|
||||
|
||||
repoIndexerOperationQueue = make(chan repoIndexerOperation, setting.Indexer.UpdateQueueLength)
|
||||
for {
|
||||
select {
|
||||
|
||||
Reference in new issue
Block a user