Skip to content

Commit

Permalink
Merge pull request #196 from WeihanLi/dev
Browse files Browse the repository at this point in the history
1.0.64 preview 2
  • Loading branch information
WeihanLi authored Mar 13, 2024
2 parents df728f7 + 6c309a9 commit 69449b6
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 836 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
6.x
7.x
8.x
9.0.100-preview.1.24101.2
9.x
- name: dotnet info
run: dotnet --info
- name: build
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/docfx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
branches:
- main
- master
# - dev
jobs:
build:
name: Build
Expand All @@ -20,15 +19,13 @@ jobs:
6.0.x
7.0.x
8.0.x
9.0.100-preview.1.24101.2
9.0.x
- name: install DocFX
run: "dotnet tool install -g docfx"
# - name: output current dir
# run: "dir"
- name: Build docs
run: "docfx ./docs/docfx.json"
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_site
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_site
2 changes: 1 addition & 1 deletion .github/workflows/dotnet-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
6.0.x
7.0.x
8.0.x
9.0.100-preview.1.24101.2
9.0.x
- name: build
run: dotnet build
- name: format
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
6.0.x
7.0.x
8.0.x
9.0.100-preview.1.24101.2
9.0.x
- name: Build
shell: pwsh
run: .\build.ps1 --stable=true
Expand Down
16 changes: 8 additions & 8 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<ExtensionPackageVersion Condition="'$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFramework)' == 'netstandard2.1' OR '$(TargetFramework)' == 'net6.0'">6.0.0</ExtensionPackageVersion>
<ExtensionPackageVersion Condition="'$(TargetFramework)' == 'net7.0'">7.0.0</ExtensionPackageVersion>
<ExtensionPackageVersion Condition="'$(TargetFramework)' == 'net8.0'">8.0.0</ExtensionPackageVersion>
<ExtensionPackageVersion Condition="'$(TargetFramework)' == 'net9.0'">9.0.0-preview.1.24080.9</ExtensionPackageVersion>
<ExtensionPackageVersion Condition="'$(TargetFramework)' == 'net9.0'">9.0.0-preview.2.24128.5</ExtensionPackageVersion>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="$(ExtensionPackageVersion)" />
Expand All @@ -19,24 +19,24 @@
<PackageVersion Include="Serilog" Version="3.1.1" />
</ItemGroup>
<ItemGroup>
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageVersion Include="FluentAssertions" Version="6.6.0" />
<PackageVersion Include="Moq" Version="4.18.4" />
<PackageVersion Include="xunit" Version="2.6.4" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.6" />
<PackageVersion Include="xunit" Version="2.7.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.7" />
<PackageVersion Include="Xunit.DependencyInjection" Version="8.7.1" />
<PackageVersion Include="Xunit.DependencyInjection.Logging" Version="8.1.0" />
<PackageVersion Include="coverlet.collector" Version="6.0.0" />
<PackageVersion Include="BenchmarkDotNet" Version="0.13.10" />
<PackageVersion Include="BenchmarkDotNet" Version="0.13.12" />
</ItemGroup>
<ItemGroup>
<PackageVersion Include="Microsoft.EntityFrameworkCore" Version="8.0.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.InMemory" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.ObjectPool" Version=" 8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageVersion Include="Serilog.Sinks.Console" Version="5.0.0" />
<PackageVersion Include="System.Data.SqlClient" Version="4.8.5" />
<PackageVersion Include="Dapper" Version="2.1.21" />
<PackageVersion Include="Serilog.Sinks.Console" Version="5.0.1" />
<PackageVersion Include="System.Data.SqlClient" Version="4.8.6" />
<PackageVersion Include="Dapper" Version="2.1.35" />
</ItemGroup>
<ItemGroup>
<GlobalPackageReference Include="PolySharp" Version="1.14.1" />
Expand Down
4 changes: 2 additions & 2 deletions samples/DotNetCoreSample/CronHelperTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ public static void MainTest()
var nextTickUtc = CronHelper.GetNextOccurrence("0 15 10 * * ?");
var nextTickLocal = CronHelper.GetNextOccurrence("0 15 10 * * ?", TimeZoneInfo.Local);

Console.WriteLine($"@utc next tick: {nextTickUtc.GetValueOrDefault().DateTime.ToStandardTimeString()} {Environment.NewLine} local next tick:{nextTickLocal.GetValueOrDefault().DateTime.ToStandardTimeString()}");
Console.WriteLine($"@utc next tick: {nextTickUtc.GetValueOrDefault().DateTime.ToTimeString()} {Environment.NewLine} local next tick:{nextTickLocal.GetValueOrDefault().DateTime.ToTimeString()}");

var nextTicks = CronHelper.GetNextOccurrences("0 15 10-20 * * ?", TimeSpan.FromHours(6), TimeZoneInfo.Local).Take(5).ToArray();
foreach (var tick in nextTicks)
{
Console.WriteLine(tick.DateTime.ToStandardTimeString());
Console.WriteLine(tick.DateTime.ToTimeString());
}
}
}
1 change: 1 addition & 0 deletions src/WeihanLi.Common/Event/EventProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ public sealed class EventProperties: Dictionary<string, object?>, IEventBase
public DateTimeOffset EventAt { get; set; }
public string EventId { get; set; } = Guid.NewGuid().ToString();
public string? TraceId { get; set; }
public string? EventSource { get; set; }
}
2 changes: 1 addition & 1 deletion src/WeihanLi.Common/Event/EventQueueInMemory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public bool Enqueue<TEvent>(string queueName, TEvent @event, EventProperties? pr

public Task<bool> EnqueueAsync<TEvent>(string queueName, TEvent @event, EventProperties? properties = null) => Task.FromResult(Enqueue(queueName, @event, properties));

public Task<bool> TryDequeueAsync(string queueName, [MaybeNullWhen(false)]out object @event, [MaybeNullWhen(false)]out EventProperties properties)
public Task<bool> TryDequeueAsync(string queueName, [NotNullWhen(true)]out object? @event, [NotNullWhen(true)]out EventProperties? properties)
{
@event = default;
properties = default;
Expand Down
2 changes: 1 addition & 1 deletion src/WeihanLi.Common/Event/EventSubscriptionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public sealed class EventSubscriptionManagerInMemory : IEventSubscriptionManager
public bool Subscribe(Type eventType, Type eventHandlerType)
{
var handlers = _eventHandlers.GetOrAdd(eventType, []);
return handlers.TryAdd((IEventHandler)DependencyResolver.Current.GetService(eventHandlerType));
return handlers.TryAdd((IEventHandler)Guard.NotNull(DependencyResolver.Current.GetService(eventHandlerType)));
}

public Task<bool> SubscribeAsync(Type eventType, Type eventHandlerType)
Expand Down
Loading

0 comments on commit 69449b6

Please sign in to comment.