Skip to content

Commit 0665db7

Browse files
authored
Merge pull request #74 from TRUMPF-IoT/7.0.1-prepare
C-DEngine update and shutdown exception fix.
2 parents aed2646 + 3823d9b commit 0665db7

File tree

4 files changed

+20
-44
lines changed

4 files changed

+20
-44
lines changed

Directory.Packages.props

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ SPDX-License-Identifier: MPL-2.0
99
<CentralPackageTransitivePinningEnabled>false</CentralPackageTransitivePinningEnabled>
1010
</PropertyGroup>
1111
<ItemGroup>
12-
<PackageVersion Include="C-DEngine" Version="5.171.1" />
12+
<PackageVersion Include="C-DEngine" Version="5.171.2" />
1313
<PackageVersion Include="coverlet.collector" Version="6.0.0" />
1414
<PackageVersion Include="LiteDB" Version="5.0.17" />
1515
<PackageVersion Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
@@ -31,8 +31,8 @@ SPDX-License-Identifier: MPL-2.0
3131
<PackageVersion Include="System.Data.SQLite.Core" Version="1.0.118" />
3232
<PackageVersion Include="System.IO.Abstractions" Version="19.2.87" />
3333
<PackageVersion Include="System.Text.Json" Version="8.0.0" />
34-
<PackageVersion Include="xunit" Version="2.6.1" />
35-
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.3" />
34+
<PackageVersion Include="xunit" Version="2.6.2" />
35+
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.4" />
3636
</ItemGroup>
3737
<ItemGroup>
3838
<GlobalPackageReference Include="MinVer" Version="4.3.0">

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
![License](https://img.shields.io/github/license/trumpf-iot/saf)
44
![Nuget](https://img.shields.io/nuget/v/SAF.Common)
5-
![.NET Core](https://github.com/TRUMPF-IoT/saf/workflows/.NET%20Core/badge.svg)
5+
![.NET Core](https://github.com/trumpf-iot/saf/actions/workflows/dotnet-core.yml/badge.svg?branch=master)
66

77
The Smart Application Framework (SAF) is an open-source and cross-plattform framework for building distributed applications across cloud and edge. It allows developers to build resilient, stateless and stateful plug-ins that run on cloud and edge.
88

src/Hosting/SAF.Hosting.Tests/ServiceHostTests.cs

-24
Original file line numberDiff line numberDiff line change
@@ -49,30 +49,6 @@ public async Task StartsAndStopsLoadedServices(bool asyncService)
4949
Assert.Equal(0, callCounters.KillCalled);
5050
}
5151

52-
[Theory]
53-
[InlineData(false)]
54-
[InlineData(true)]
55-
public async Task StopsLoadedServicesOnDispose(bool asyncService)
56-
{
57-
// Arrange
58-
var callCounters = new CallCounters();
59-
using (var sut = SetupServiceHostWithCallCountersService(callCounters, asyncService))
60-
{
61-
// Act
62-
await sut.StartAsync(CancellationToken.None);
63-
64-
// Assert
65-
Assert.Equal(1, callCounters.StartCalled);
66-
Assert.Equal(0, callCounters.StopCalled);
67-
Assert.Equal(0, callCounters.KillCalled);
68-
}
69-
70-
// Assert
71-
Assert.Equal(1, callCounters.StartCalled);
72-
Assert.Equal(1, callCounters.StopCalled);
73-
Assert.Equal(0, callCounters.KillCalled);
74-
}
75-
7652
[Theory]
7753
[InlineData(false)]
7854
[InlineData(true)]

src/Hosting/SAF.Hosting/ServiceHost.cs

+16-16
Original file line numberDiff line numberDiff line change
@@ -66,21 +66,6 @@ public Task StartAsync(CancellationToken cancellationToken)
6666
}
6767
}, cancellationToken);
6868

69-
private async Task StartInternalAsync(CancellationToken token)
70-
{
71-
var stopWatch = new Stopwatch();
72-
stopWatch.Start();
73-
74-
InitializeServices();
75-
AddRuntimeMessageHandlersToDispatcher();
76-
77-
await StartServicesAsync(_services, token);
78-
79-
stopWatch.Stop();
80-
81-
_log.LogInformation($"Starting all services took {stopWatch.Elapsed.TotalMilliseconds * 1000000:N0} ns");
82-
}
83-
8469
public async Task StopAsync(CancellationToken cancellationToken)
8570
{
8671
if (_services.Count == 0)
@@ -115,7 +100,22 @@ public async Task StopAsync(CancellationToken cancellationToken)
115100

116101
public void Dispose()
117102
{
118-
StopAsync(CancellationToken.None).Wait();
103+
// intentionally left blank
104+
}
105+
106+
private async Task StartInternalAsync(CancellationToken token)
107+
{
108+
var stopWatch = new Stopwatch();
109+
stopWatch.Start();
110+
111+
InitializeServices();
112+
AddRuntimeMessageHandlersToDispatcher();
113+
114+
await StartServicesAsync(_services, token);
115+
116+
stopWatch.Stop();
117+
118+
_log.LogInformation($"Starting all services took {stopWatch.Elapsed.TotalMilliseconds * 1000000:N0} ns");
119119
}
120120

121121
private async Task StartServicesAsync(IEnumerable<IHostedServiceBase> services, CancellationToken cancelToken)

0 commit comments

Comments
 (0)