mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	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).
This commit is contained in:
		@@ -16,8 +16,9 @@ type Indexer struct{}
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
// Init initializes the indexer
 | 
					// Init initializes the indexer
 | 
				
			||||||
func (i *Indexer) Init(_ context.Context) (bool, error) {
 | 
					func (i *Indexer) Init(_ context.Context) (bool, error) {
 | 
				
			||||||
	// nothing to do
 | 
						// Return true to indicate that the index was opened/existed.
 | 
				
			||||||
	return false, nil
 | 
						// 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
 | 
					// Ping checks if the indexer is available
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user