Compare commits
5 Commits
90b4662dda
...
release/v1
Author | SHA1 | Date | |
---|---|---|---|
46bbc34956 | |||
047ccfa754 | |||
b0d9a67c1c | |||
3eb043b24c | |||
4cd476764d |
@ -12,7 +12,7 @@ indent_style = space
|
||||
tab_width = 4
|
||||
|
||||
# Предпочтения для новых строк
|
||||
end_of_line = crlf
|
||||
end_of_line = unset
|
||||
insert_final_newline = false
|
||||
|
||||
#### Действия кода .NET ####
|
||||
@ -244,7 +244,7 @@ dotnet_naming_style.begins_with_i.capitalization = pascal_case
|
||||
dotnet_style_operator_placement_when_wrapping = beginning_of_line
|
||||
tab_width = 4
|
||||
indent_size = 4
|
||||
end_of_line = crlf
|
||||
end_of_line = unset
|
||||
dotnet_style_coalesce_expression = true:suggestion
|
||||
dotnet_style_null_propagation = true:suggestion
|
||||
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
|
||||
|
2
.github/workflows/code-analyze.yaml
vendored
2
.github/workflows/code-analyze.yaml
vendored
@ -23,7 +23,7 @@ jobs:
|
||||
sonarProjectKey: $(echo "${{ github.repository }}" | cut -d'/' -f2)
|
||||
sonarProjectName: $(echo "${{ github.repository }}" | cut -d'/' -f2)
|
||||
sonarHostname: ${{ secrets.SONAR_HOST_URL }}
|
||||
dotnetPreBuildCmd: dotnet nuget add source --name="Winsomnia" --username ${secrets.NUGET_USERNAME} --password ${{ secrets.NUGET_PASSWORD }} --store-password-in-clear-text ${secrets.NUGET_ADDRESS} && dotnet format --verify-no-changes --diagnostics -v diag --severity warn
|
||||
dotnetPreBuildCmd: dotnet nuget add source --name="Winsomnia" --username ${{ secrets.NUGET_USERNAME }} --password ${{ secrets.NUGET_PASSWORD }} --store-password-in-clear-text ${{ secrets.NUGET_ADDRESS }} && dotnet format --verify-no-changes --diagnostics -v diag --severity warn
|
||||
dotnetTestArguments: --logger trx --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover
|
||||
sonarBeginArguments: /d:sonar.cs.opencover.reportsPaths="**/TestResults/**/coverage.opencover.xml" -d:sonar.cs.vstest.reportsPaths="**/TestResults/*.trx"
|
||||
env:
|
||||
|
@ -45,32 +45,31 @@ public static class CronUpdateSkipService
|
||||
if (depth <= 0)
|
||||
return [];
|
||||
|
||||
currentDate ??= DateOnly.FromDateTime(DateTime.Now);
|
||||
DateTimeOffset nextRunTime = currentDate.Value.ToDateTime(TimeOnly.FromDateTime(DateTime.Now));
|
||||
|
||||
DateTimeOffset nextRunTime = (currentDate?.ToDateTime(TimeOnly.MinValue) ?? DateTime.Now).ToUniversalTime();
|
||||
List<DateTimeOffset> result = [];
|
||||
|
||||
do
|
||||
{
|
||||
var lastSkip = data.FilterDateEntry(nextRunTime.DateTime).LastOrDefault();
|
||||
var lastSkippedEntry = data.FilterDateEntry(nextRunTime.DateTime).LastOrDefault();
|
||||
|
||||
if (lastSkip is { Start: not null, End: not null })
|
||||
nextRunTime = new DateTimeOffset(lastSkip.End.Value.AddDays(1), new TimeOnly(0, 0, 0), TimeSpan.Zero);
|
||||
else if (lastSkip.Date.HasValue)
|
||||
nextRunTime = new DateTimeOffset(lastSkip.Date.Value.AddDays(1), new TimeOnly(0, 0, 0), TimeSpan.Zero);
|
||||
if (lastSkippedEntry is { Start: not null, End: not null })
|
||||
nextRunTime = lastSkippedEntry.End.Value.ToDateTime(TimeOnly.MinValue).AddDays(1);
|
||||
else if (lastSkippedEntry.Date.HasValue)
|
||||
nextRunTime = lastSkippedEntry.Date.Value.ToDateTime(TimeOnly.MinValue).AddDays(1);
|
||||
|
||||
var next = expression.GetNextOccurrence(nextRunTime.ToUniversalTime(), TimeZoneInfo.Local);
|
||||
var nextOccurrence = expression.GetNextOccurrence(nextRunTime.AddMinutes(-1), TimeZoneInfo.Local);
|
||||
|
||||
if (!next.HasValue)
|
||||
if (!nextOccurrence.HasValue)
|
||||
return result;
|
||||
|
||||
nextRunTime = next.Value;
|
||||
|
||||
if (data.FilterDateEntry(nextRunTime.DateTime).Any())
|
||||
if (data.FilterDateEntry(nextOccurrence.Value.DateTime).Count != 0)
|
||||
{
|
||||
nextRunTime = nextOccurrence.Value.AddDays(1);
|
||||
continue;
|
||||
}
|
||||
|
||||
result.Add(nextRunTime);
|
||||
nextRunTime = nextRunTime.AddMinutes(1);
|
||||
result.Add(nextOccurrence.Value.ToLocalTime());
|
||||
nextRunTime = nextOccurrence.Value.AddMinutes(1);
|
||||
|
||||
} while (result.Count < depth);
|
||||
|
||||
|
@ -203,10 +203,10 @@ public class ScheduleController(ILogger<ScheduleController> logger, IOptionsSnap
|
||||
{
|
||||
try
|
||||
{
|
||||
using var scope = scopeFactory.CreateScope();
|
||||
using var scope = scopeFactory.CreateScope();
|
||||
var sync = (ScheduleSynchronizer)ActivatorUtilities.GetServiceOrCreateInstance(scope.ServiceProvider, typeof(ScheduleSynchronizer));
|
||||
|
||||
await sync.StartSync(filePaths, CancellationToken.None);
|
||||
await sync.StartSync(filePaths, CancellationToken.None);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
Reference in New Issue
Block a user