Skip to content

Commit

Permalink
Reduce default query timeout for contacting build servers from the wi…
Browse files Browse the repository at this point in the history
…zard.

- Slightly beautify the wizard start page
  • Loading branch information
steffen-wilke committed Oct 12, 2020
1 parent 365369b commit 07a08f1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,19 @@
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
mc:Ignorable="d">
<DockPanel HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<TextBlock Height="100"
Margin="10,50,10,0"
<TextBlock Height="52
"
Margin="10,10,10,0"
DockPanel.Dock="Top"
FontSize="16"
Text="Welcome to the project wizard.&#xD;&#xA;&#xA;Please select the project type that you would like to add and provide the URL to the build server."
FontSize="32"
Text="Welcome to the project wizard"
TextWrapping="Wrap" />
<TextBlock Height="104"
Margin="10,10,10,0"
DockPanel.Dock="Top"
FontSize="16"
Text="Please select the project type that you would like to add and provide the URL to the build server."
TextWrapping="Wrap" />
<StackPanel Margin="6"
VerticalAlignment="Center"
DockPanel.Dock="Bottom"
Expand All @@ -42,7 +49,7 @@
ItemsSource="{Binding AvailableServers, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"
KeyUp="ConnectionAdressKeyUp"
Text="{Binding ProposedServerAddress}" />
<CheckBox x:Name="AutoDetectionCheckbox" Content="Automatically detect type " IsChecked="{Binding IsAutoDetectionEnabled, Mode=TwoWay}" Margin="10,20,10,10" HorizontalAlignment="Center"/>
<CheckBox x:Name="AutoDetectionCheckbox" Content="Automatically recognize build system type" IsChecked="{Binding IsAutoDetectionEnabled, Mode=TwoWay}" Margin="0,20,0,10" HorizontalAlignment="Left"/>
</StackPanel>
</StackPanel>
</DockPanel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ namespace Soloplan.WhatsON.GUI.Configuration.Wizard
/// <seealso cref="System.ComponentModel.INotifyPropertyChanged" />
public class WizardController : INotifyPropertyChanged
{
/// <summary>
/// The timeout used to detect timeouts when querying build servers.
/// </summary>
private const int QueryTimeout = 10000;

/// <summary>
/// Logger instance used by this class.
/// </summary>
Expand Down Expand Up @@ -633,7 +638,7 @@ private async Task PrepareProjectsList()
}

var taskList = new Dictionary<Task, ProjectViewModelList>();
var timeoutTask = Task.Delay(25000);
var timeoutTask = Task.Delay(QueryTimeout);
taskList.Add(timeoutTask, null);
var task = this.LoadProjectsFromPlugin(pluginToQueryWithModel);
taskList.Add(task, pluginToQueryWithModel.Item2);
Expand Down Expand Up @@ -683,7 +688,7 @@ private async Task PrepareProjectsListWithTypeDetection()
}

var taskList = new Dictionary<Task, ProjectViewModelList>();
var timeoutTask = Task.Delay(25000);
var timeoutTask = Task.Delay(QueryTimeout);
taskList.Add(timeoutTask, null);
foreach (var pluginToQueryWithModel in pluginToQueryWithModels)
{
Expand Down

0 comments on commit 07a08f1

Please sign in to comment.