if (descriptor != null && descriptor.shouldKeepInWorkspace) {
return null;
}
// Check for builds in the queue which have the same emulator config as this task
Queue queue = Hudson.getInstance().getQueue();
for (BuildableItem item : queue.getBuildableItems()) {
Task queuedTask = item.task;
if (task == queuedTask) {
continue;
}
// If build with matching config is about to start (is "pending"), hold off for a moment
if (queue.isPending(queuedTask)) {
String queuedTaskHash = getEmulatorConfigHashForTask(node, queuedTask);
if (desiredHash.equals(queuedTaskHash)) {
return CauseOfBlockage.fromMessage(Messages._WAITING_FOR_EMULATOR());
}
}