Skip to content

Commit 2c1dea6

Browse files
andreasohlundramonsmitsmauroservienti
authored
Use correct name for the instance setup phase (#4835)
* Use correct name for the instance setup phase * Cleanup * Added 'can take a very long time' * Apply suggestions from code review Co-authored-by: Mauro Servienti <[email protected]> --------- Co-authored-by: Ramon Smits <[email protected]> Co-authored-by: Mauro Servienti <[email protected]>
1 parent 87cae8b commit 2c1dea6

14 files changed

+100
-175
lines changed

src/ServiceControl.Config/Framework/Modules/InstallerModule.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ internal async Task<ReportCard> Add(ServiceControlInstallableBase details, IProg
6767
{
6868
progress.Report(5, 9, "Registering URL ACLs...");
6969
instanceInstaller.RegisterUrlAcl();
70-
progress.Report(6, 9, "Creating queues...");
70+
progress.Report(6, 9, "Instance setup in progress, this could take several minutes...");
7171
instanceInstaller.SetupInstance();
7272
}
7373
catch (Exception ex)
@@ -141,7 +141,7 @@ internal ReportCard Upgrade(ServiceControlBaseService instance, ServiceControlUp
141141

142142
UpgradeOptions(upgradeOptions, instance);
143143

144-
progress.Report(++currentStep, totalSteps, "Running Queue Creation...");
144+
progress.Report(++currentStep, totalSteps, "Instance setup in progress, this could take several minutes...");
145145
instance.SetupInstance();
146146

147147
instance.ReportCard.SetStatus();

src/ServiceControlInstaller.Engine/Instances/MonitoringInstance.cs

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
using Configuration;
1212
using Configuration.Monitoring;
1313
using FileSystem;
14-
using Queues;
1514
using ReportCard;
1615
using Services;
16+
using Setup;
1717
using UrlAcl;
1818
using Validation;
1919

@@ -188,13 +188,9 @@ public void ApplyConfigChange()
188188
{
189189
try
190190
{
191-
QueueCreation.RunQueueCreation(this);
191+
InstanceSetup.Run(this);
192192
}
193-
catch (QueueCreationFailedException ex)
194-
{
195-
ReportCard.Errors.Add(ex.Message);
196-
}
197-
catch (QueueCreationTimeoutException ex)
193+
catch (Exception ex)
198194
{
199195
ReportCard.Errors.Add(ex.Message);
200196
}
@@ -278,13 +274,9 @@ public void SetupInstance()
278274
{
279275
try
280276
{
281-
QueueCreation.RunQueueCreation(this);
282-
}
283-
catch (QueueCreationFailedException ex)
284-
{
285-
ReportCard.Errors.Add(ex.Message);
277+
InstanceSetup.Run(this);
286278
}
287-
catch (QueueCreationTimeoutException ex)
279+
catch (Exception ex)
288280
{
289281
ReportCard.Errors.Add(ex.Message);
290282
}

src/ServiceControlInstaller.Engine/Instances/MonitoringNewInstance.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
using Configuration.Monitoring;
1212
using FileSystem;
1313
using NuGet.Versioning;
14-
using Queues;
14+
using Setup;
1515
using ReportCard;
1616
using Services;
1717
using UrlAcl;
@@ -148,13 +148,9 @@ public void SetupInstance()
148148
{
149149
try
150150
{
151-
QueueCreation.RunQueueCreation(this);
151+
InstanceSetup.Run(this);
152152
}
153-
catch (QueueCreationFailedException ex)
154-
{
155-
ReportCard.Errors.Add(ex.Message);
156-
}
157-
catch (QueueCreationTimeoutException ex)
153+
catch (Exception ex)
158154
{
159155
ReportCard.Errors.Add(ex.Message);
160156
}

src/ServiceControlInstaller.Engine/Instances/ServiceControlAuditInstance.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ namespace ServiceControlInstaller.Engine.Instances
88
using Configuration;
99
using Configuration.ServiceControl;
1010
using FileSystem;
11-
using Queues;
12-
using ServiceControlInstaller.Engine.Validation;
11+
using Setup;
12+
using Validation;
1313
using Services;
1414

1515
public class ServiceControlAuditInstance : ServiceControlBaseService, IServiceControlAuditInstance
@@ -57,7 +57,7 @@ protected override AppConfig CreateAppConfig()
5757
protected override TransportInfo DetermineTransportPackage()
5858
{
5959
var transportAppSetting = (AppConfig.Read<string>(AuditInstanceSettingsList.TransportType, null)?.Trim())
60-
?? throw new Exception($"{AuditInstanceSettingsList.TransportType.Name} setting not found in app.config.");
60+
?? throw new Exception($"{AuditInstanceSettingsList.TransportType.Name} setting not found in app.config.");
6161

6262
var transport = ServiceControlCoreTransports.Find(transportAppSetting);
6363

@@ -102,9 +102,9 @@ public override void Reload()
102102
EnableFullTextSearchOnBodies = AppConfig.Read(AuditInstanceSettingsList.EnableFullTextSearchOnBodies, true);
103103
}
104104

105-
public override void RunQueueCreation()
105+
public override void RunSetup()
106106
{
107-
QueueCreation.RunQueueCreation(this);
107+
InstanceSetup.Run(this);
108108
}
109109

110110
protected override void Prepare(string zipResourceName, string destDir)

src/ServiceControlInstaller.Engine/Instances/ServiceControlAuditNewInstance.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
{
33
using System;
44
using System.IO;
5-
using System.Xml;
65
using System.Xml.Serialization;
76
using Configuration.ServiceControl;
8-
using Queues;
7+
using Setup;
98
using Services;
109
using Validation;
1110

@@ -58,9 +57,9 @@ internal override WindowsServiceDetails GetWindowsServiceDetails()
5857
};
5958
}
6059

61-
protected override void RunQueueCreation()
60+
protected override void RunSetup()
6261
{
63-
QueueCreation.RunQueueCreation(this);
62+
InstanceSetup.Run(this);
6463
}
6564

6665
protected override void ValidateMaintenancePort()

src/ServiceControlInstaller.Engine/Instances/ServiceControlBaseService.cs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ namespace ServiceControlInstaller.Engine.Instances
1212
using Configuration;
1313
using FileSystem;
1414
using NuGet.Versioning;
15-
using Queues;
1615
using ReportCard;
1716
using Services;
1817
using UrlAcl;
@@ -383,19 +382,15 @@ public void RestoreAppConfig(string sourcePath)
383382
AppConfig.Save();
384383
}
385384

386-
public abstract void RunQueueCreation();
385+
public abstract void RunSetup();
387386

388387
public void SetupInstance()
389388
{
390389
try
391390
{
392-
RunQueueCreation();
391+
RunSetup();
393392
}
394-
catch (QueueCreationFailedException ex)
395-
{
396-
ReportCard.Errors.Add(ex.Message);
397-
}
398-
catch (QueueCreationTimeoutException ex)
393+
catch (Exception ex)
399394
{
400395
ReportCard.Errors.Add(ex.Message);
401396
}

src/ServiceControlInstaller.Engine/Instances/ServiceControlInstallableBase.cs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
using Accounts;
1212
using FileSystem;
1313
using NuGet.Versioning;
14-
using Queues;
1514
using ReportCard;
1615
using Services;
1716
using UrlAcl;
@@ -197,7 +196,7 @@ protected List<string> GetServiceDependencies()
197196

198197
internal abstract WindowsServiceDetails GetWindowsServiceDetails();
199198

200-
protected abstract void RunQueueCreation();
199+
protected abstract void RunSetup();
201200

202201
public void RegisterUrlAcl()
203202
{
@@ -221,13 +220,9 @@ public void SetupInstance()
221220
{
222221
try
223222
{
224-
RunQueueCreation();
223+
RunSetup();
225224
}
226-
catch (QueueCreationFailedException ex)
227-
{
228-
ReportCard.Errors.Add(ex.Message);
229-
}
230-
catch (QueueCreationTimeoutException ex)
225+
catch (Exception ex)
231226
{
232227
ReportCard.Errors.Add(ex.Message);
233228
}

src/ServiceControlInstaller.Engine/Instances/ServiceControlInstance.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ namespace ServiceControlInstaller.Engine.Instances
99
using Configuration;
1010
using Configuration.ServiceControl;
1111
using FileSystem;
12-
using Queues;
1312
using Services;
13+
using Setup;
1414
using Validation;
1515

1616
using AppConfig = Configuration.ServiceControl.AppConfig;
@@ -56,9 +56,9 @@ protected override AppConfig CreateAppConfig()
5656
return new ServiceControlAppConfig(this);
5757
}
5858

59-
public override void RunQueueCreation()
59+
public override void RunSetup()
6060
{
61-
QueueCreation.RunQueueCreation(this);
61+
InstanceSetup.Run(this);
6262
}
6363

6464
protected override void ValidateQueueNames()

src/ServiceControlInstaller.Engine/Instances/ServiceControlNewInstance.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ namespace ServiceControlInstaller.Engine.Instances
77
using System.Xml;
88
using System.Xml.Serialization;
99
using Configuration.ServiceControl;
10-
using Queues;
1110
using Services;
11+
using Setup;
1212
using Validation;
1313

1414
public class ServiceControlNewInstance : ServiceControlInstallableBase, IServiceControlInstance
@@ -85,9 +85,9 @@ internal override WindowsServiceDetails GetWindowsServiceDetails()
8585
};
8686
}
8787

88-
protected override void RunQueueCreation()
88+
protected override void RunSetup()
8989
{
90-
QueueCreation.RunQueueCreation(this);
90+
InstanceSetup.Run(this);
9191
}
9292

9393
protected override void ValidateMaintenancePort()

src/ServiceControlInstaller.Engine/Queues/QueueCreation.cs

Lines changed: 0 additions & 77 deletions
This file was deleted.

0 commit comments

Comments
 (0)