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
|
tab_width = 4
|
||||||
|
|
||||||
# Предпочтения для новых строк
|
# Предпочтения для новых строк
|
||||||
end_of_line = crlf
|
end_of_line = unset
|
||||||
insert_final_newline = false
|
insert_final_newline = false
|
||||||
|
|
||||||
#### Действия кода .NET ####
|
#### Действия кода .NET ####
|
||||||
@ -244,7 +244,7 @@ dotnet_naming_style.begins_with_i.capitalization = pascal_case
|
|||||||
dotnet_style_operator_placement_when_wrapping = beginning_of_line
|
dotnet_style_operator_placement_when_wrapping = beginning_of_line
|
||||||
tab_width = 4
|
tab_width = 4
|
||||||
indent_size = 4
|
indent_size = 4
|
||||||
end_of_line = crlf
|
end_of_line = unset
|
||||||
dotnet_style_coalesce_expression = true:suggestion
|
dotnet_style_coalesce_expression = true:suggestion
|
||||||
dotnet_style_null_propagation = true:suggestion
|
dotnet_style_null_propagation = true:suggestion
|
||||||
dotnet_style_prefer_is_null_check_over_reference_equality_method = 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)
|
sonarProjectKey: $(echo "${{ github.repository }}" | cut -d'/' -f2)
|
||||||
sonarProjectName: $(echo "${{ github.repository }}" | cut -d'/' -f2)
|
sonarProjectName: $(echo "${{ github.repository }}" | cut -d'/' -f2)
|
||||||
sonarHostname: ${{ secrets.SONAR_HOST_URL }}
|
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
|
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"
|
sonarBeginArguments: /d:sonar.cs.opencover.reportsPaths="**/TestResults/**/coverage.opencover.xml" -d:sonar.cs.vstest.reportsPaths="**/TestResults/*.trx"
|
||||||
env:
|
env:
|
||||||
|
@ -45,32 +45,31 @@ public static class CronUpdateSkipService
|
|||||||
if (depth <= 0)
|
if (depth <= 0)
|
||||||
return [];
|
return [];
|
||||||
|
|
||||||
currentDate ??= DateOnly.FromDateTime(DateTime.Now);
|
DateTimeOffset nextRunTime = (currentDate?.ToDateTime(TimeOnly.MinValue) ?? DateTime.Now).ToUniversalTime();
|
||||||
DateTimeOffset nextRunTime = currentDate.Value.ToDateTime(TimeOnly.FromDateTime(DateTime.Now));
|
|
||||||
|
|
||||||
List<DateTimeOffset> result = [];
|
List<DateTimeOffset> result = [];
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
var lastSkip = data.FilterDateEntry(nextRunTime.DateTime).LastOrDefault();
|
var lastSkippedEntry = data.FilterDateEntry(nextRunTime.DateTime).LastOrDefault();
|
||||||
|
|
||||||
if (lastSkip is { Start: not null, End: not null })
|
if (lastSkippedEntry is { Start: not null, End: not null })
|
||||||
nextRunTime = new DateTimeOffset(lastSkip.End.Value.AddDays(1), new TimeOnly(0, 0, 0), TimeSpan.Zero);
|
nextRunTime = lastSkippedEntry.End.Value.ToDateTime(TimeOnly.MinValue).AddDays(1);
|
||||||
else if (lastSkip.Date.HasValue)
|
else if (lastSkippedEntry.Date.HasValue)
|
||||||
nextRunTime = new DateTimeOffset(lastSkip.Date.Value.AddDays(1), new TimeOnly(0, 0, 0), TimeSpan.Zero);
|
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;
|
return result;
|
||||||
|
|
||||||
nextRunTime = next.Value;
|
if (data.FilterDateEntry(nextOccurrence.Value.DateTime).Count != 0)
|
||||||
|
{
|
||||||
if (data.FilterDateEntry(nextRunTime.DateTime).Any())
|
nextRunTime = nextOccurrence.Value.AddDays(1);
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
result.Add(nextRunTime);
|
result.Add(nextOccurrence.Value.ToLocalTime());
|
||||||
nextRunTime = nextRunTime.AddMinutes(1);
|
nextRunTime = nextOccurrence.Value.AddMinutes(1);
|
||||||
|
|
||||||
} while (result.Count < depth);
|
} while (result.Count < depth);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user