Mark ApprovalCopier, ApprovalsUtil and LabelNormalizer as singleton
These have no per-request state and are held by several REST API views that are themselves singletons. Instead of making one copy per REST view, make these singletons for the server. Change-Id: I2f343d29c4bed8a862b3794323916ca46b8b1f99
This commit is contained in:
@@ -38,6 +38,7 @@ import com.google.gerrit.server.project.ProjectState;
|
||||
import com.google.gerrit.server.query.change.ChangeData;
|
||||
import com.google.gwtorm.server.OrmException;
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.Singleton;
|
||||
|
||||
import org.eclipse.jgit.lib.ObjectId;
|
||||
import org.eclipse.jgit.lib.Repository;
|
||||
@@ -56,6 +57,7 @@ import java.util.TreeMap;
|
||||
* database at submit time, or refreshed on demand, as when reading approvals
|
||||
* from the notedb.
|
||||
*/
|
||||
@Singleton
|
||||
public class ApprovalCopier {
|
||||
private final GitRepositoryManager repoManager;
|
||||
private final ProjectCache projectCache;
|
||||
|
Reference in New Issue
Block a user