Move batch user priority to a capability

Instead of using a magical group, use a special capability to
denote users that should get the batch priority behavior.

Change-Id: I3e1f8f3ee39f5dcb2cdad2f9c71c46db25fc30b6
This commit is contained in:
Shawn O. Pearce
2011-06-16 18:01:21 -07:00
parent 897d9218ac
commit 76409cf7fa
24 changed files with 186 additions and 141 deletions

View File

@@ -22,10 +22,10 @@ import static javax.servlet.http.HttpServletResponse.SC_SERVICE_UNAVAILABLE;
import com.google.gerrit.server.CurrentUser;
import com.google.gerrit.server.IdentifiedUser;
import com.google.gerrit.server.config.GerritServerConfig;
import com.google.gerrit.server.git.QueueProvider;
import com.google.gerrit.server.git.WorkQueue;
import com.google.gerrit.server.git.WorkQueue.CancelableRunnable;
import com.google.gerrit.sshd.CommandExecutorQueueProvider;
import com.google.gerrit.sshd.QueueProvider;
import com.google.inject.Inject;
import com.google.inject.Provider;
import com.google.inject.Singleton;
@@ -142,13 +142,7 @@ public class ProjectQoSFilter implements Filter {
}
private WorkQueue.Executor getExecutor() {
WorkQueue.Executor executor;
if (userProvider.get().isBatchUser()) {
executor = queue.getBatchQueue();
} else {
executor = queue.getInteractiveQueue();
}
return executor;
return queue.getQueue(userProvider.get().getCapabilities().getQueueType());
}
@Override