for ( BuildContext buildContext : buildContexts )
{
BuildTrigger buildTrigger = new BuildTrigger( buildContext.getTrigger(), buildContext.getUsername() );
BuildProjectTask buildProjectTask =
new BuildProjectTask( buildContext.getProjectId(), buildContext.getBuildDefinitionId(),
buildTrigger, buildContext.getProjectName(), buildContext.getBuildDefinitionLabel(),
buildContext.getScmResult(), buildContext.getProjectGroupId() );
buildProjectTask.setMaxExecutionTime( buildContext.getMaxExecutionTime() * 1000 );
try
{
if ( !buildAgentTaskQueueManager.isProjectInBuildQueue( buildProjectTask.getProjectId() ) )
{
buildAgentTaskQueueManager.getBuildQueue().put( buildProjectTask );
}
}
catch ( TaskQueueException e )