From 05a39da8b5bb5f8b71d9066a73fabb6e2265a0e1 Mon Sep 17 00:00:00 2001 From: DCarlson12 Date: Wed, 14 Aug 2024 22:47:13 -0400 Subject: [PATCH 1/3] Test commit --- src/Hangfire.AspNetCore/packages.lock.json | 4 +--- src/Hangfire.Core/RecurringJobEntity.cs | 1 + src/Hangfire.NetCore/packages.lock.json | 1 - src/Hangfire.SqlServer/packages.lock.json | 1 - 4 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Hangfire.AspNetCore/packages.lock.json b/src/Hangfire.AspNetCore/packages.lock.json index 65bd02068..4f1bccfce 100644 --- a/src/Hangfire.AspNetCore/packages.lock.json +++ b/src/Hangfire.AspNetCore/packages.lock.json @@ -2047,7 +2047,6 @@ "Microsoft.CodeAnalysis.NetAnalyzers": "[8.0.0, )", "Microsoft.SourceLink.GitHub": "[8.0.0, )", "MoreLinq.Source.MoreEnumerable.Pairwise": "[1.0.1, )", - "NETStandard.Library": "[1.6.1, )", "Newtonsoft.Json": "[9.0.1, )", "StackTraceFormatter.Source": "[1.1.0, )", "StackTraceParser.Source": "[1.3.0, )", @@ -2062,8 +2061,7 @@ "Microsoft.CodeAnalysis.NetAnalyzers": "[8.0.0, )", "Microsoft.Extensions.DependencyInjection.Abstractions": "[1.0.0, )", "Microsoft.Extensions.Logging.Abstractions": "[1.0.0, )", - "Microsoft.SourceLink.GitHub": "[8.0.0, )", - "NETStandard.Library": "[1.6.1, )" + "Microsoft.SourceLink.GitHub": "[8.0.0, )" } } }, diff --git a/src/Hangfire.Core/RecurringJobEntity.cs b/src/Hangfire.Core/RecurringJobEntity.cs index 7116b248b..28036cc30 100644 --- a/src/Hangfire.Core/RecurringJobEntity.cs +++ b/src/Hangfire.Core/RecurringJobEntity.cs @@ -127,6 +127,7 @@ public RecurringJobEntity( public int? Version { get; private set; } public int RetryAttempt { get; set; } public string Error { get; set; } + public bool Disabled { get; set; } public void ScheduleNext(ITimeZoneResolver timeZoneResolver, DateTime from) { diff --git a/src/Hangfire.NetCore/packages.lock.json b/src/Hangfire.NetCore/packages.lock.json index 8a3194ce0..aec4ca1f5 100644 --- a/src/Hangfire.NetCore/packages.lock.json +++ b/src/Hangfire.NetCore/packages.lock.json @@ -1273,7 +1273,6 @@ "Microsoft.CodeAnalysis.NetAnalyzers": "[8.0.0, )", "Microsoft.SourceLink.GitHub": "[8.0.0, )", "MoreLinq.Source.MoreEnumerable.Pairwise": "[1.0.1, )", - "NETStandard.Library": "[1.6.1, )", "Newtonsoft.Json": "[9.0.1, )", "StackTraceFormatter.Source": "[1.1.0, )", "StackTraceParser.Source": "[1.3.0, )", diff --git a/src/Hangfire.SqlServer/packages.lock.json b/src/Hangfire.SqlServer/packages.lock.json index 544af2c85..cefee266a 100644 --- a/src/Hangfire.SqlServer/packages.lock.json +++ b/src/Hangfire.SqlServer/packages.lock.json @@ -1281,7 +1281,6 @@ "Microsoft.CodeAnalysis.NetAnalyzers": "[8.0.0, )", "Microsoft.SourceLink.GitHub": "[8.0.0, )", "MoreLinq.Source.MoreEnumerable.Pairwise": "[1.0.1, )", - "NETStandard.Library": "[1.6.1, )", "Newtonsoft.Json": "[9.0.1, )", "StackTraceFormatter.Source": "[1.1.0, )", "StackTraceParser.Source": "[1.3.0, )", From 8b2c8f6082b61b18062acf0b801650b92bcf8836 Mon Sep 17 00:00:00 2001 From: DCarlson12 Date: Thu, 15 Aug 2024 01:02:03 -0400 Subject: [PATCH 2/3] Add recurring job management for enabling and disabling recurring jobs --- Hangfire.sln | 7 + .../Dashboard/AspNetCoreDashboardContext.cs | 11 + src/Hangfire.AspNetCore/packages.lock.json | 4 +- .../Content/resx/Strings.Designer.cs | 63 ++++ .../Dashboard/Content/resx/Strings.resx | 21 ++ .../Dashboard/DashboardContext.cs | 5 + .../Dashboard/DashboardRoutes.cs | 8 + .../Dashboard/Pages/RecurringJobsPage.cshtml | 26 +- .../Pages/RecurringJobsPage.cshtml.cs | 290 +++++++++++++----- .../Dashboard/RouteCollectionExtensions.cs | 14 + src/Hangfire.Core/IRecurringJobManager.cs | 3 + src/Hangfire.Core/RecurringJob.cs | 15 + src/Hangfire.Core/RecurringJobEntity.cs | 12 +- src/Hangfire.Core/RecurringJobManager.cs | 91 +++++- .../Server/RecurringJobScheduler.cs | 5 + src/Hangfire.NetCore/packages.lock.json | 1 + src/Hangfire.SqlServer/packages.lock.json | 1 + 17 files changed, 488 insertions(+), 89 deletions(-) diff --git a/Hangfire.sln b/Hangfire.sln index 967f0a926..c5afcfc69 100644 --- a/Hangfire.sln +++ b/Hangfire.sln @@ -58,6 +58,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetCoreSample", "samples\Ne EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Hangfire.NetCore", "src\Hangfire.NetCore\Hangfire.NetCore.csproj", "{AA8E3A67-8731-423A-9B69-EE44EC6B8E1A}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MinimalApiSample", "samples\MinimalApiSample\MinimalApiSample.csproj", "{BB3A67A7-BDC8-4B27-85F4-EE3B27C33F61}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -104,6 +106,10 @@ Global {AA8E3A67-8731-423A-9B69-EE44EC6B8E1A}.Debug|Any CPU.Build.0 = Debug|Any CPU {AA8E3A67-8731-423A-9B69-EE44EC6B8E1A}.Release|Any CPU.ActiveCfg = Release|Any CPU {AA8E3A67-8731-423A-9B69-EE44EC6B8E1A}.Release|Any CPU.Build.0 = Release|Any CPU + {BB3A67A7-BDC8-4B27-85F4-EE3B27C33F61}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BB3A67A7-BDC8-4B27-85F4-EE3B27C33F61}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BB3A67A7-BDC8-4B27-85F4-EE3B27C33F61}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BB3A67A7-BDC8-4B27-85F4-EE3B27C33F61}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -114,6 +120,7 @@ Global {6DFFA275-C483-4501-823A-741AC9EC0846} = {766BE831-F758-46BC-AFD3-BBEEFE0F686F} {DBC6BC12-06AD-4597-9E0F-B77BE754FA2C} = {766BE831-F758-46BC-AFD3-BBEEFE0F686F} {FA751692-20C8-4986-8164-D21F505B2172} = {119DA7FA-B94C-4B63-AEC9-428EF834E0D8} + {BB3A67A7-BDC8-4B27-85F4-EE3B27C33F61} = {119DA7FA-B94C-4B63-AEC9-428EF834E0D8} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {7597454C-C272-4016-87A2-CF1196347355} diff --git a/src/Hangfire.AspNetCore/Dashboard/AspNetCoreDashboardContext.cs b/src/Hangfire.AspNetCore/Dashboard/AspNetCoreDashboardContext.cs index 193fcdb2f..cb1e0e639 100644 --- a/src/Hangfire.AspNetCore/Dashboard/AspNetCoreDashboardContext.cs +++ b/src/Hangfire.AspNetCore/Dashboard/AspNetCoreDashboardContext.cs @@ -69,5 +69,16 @@ public override IRecurringJobManager GetRecurringJobManager() return HttpContext.RequestServices.GetService() ?? base.GetRecurringJobManager(); } + + public override IRecurringJobManagerV2 GetRecurringJobManagerV2() + { + var factory = HttpContext.RequestServices.GetService(); + if (factory != null) + { + return factory.GetManagerV2(Storage); + } + + return HttpContext.RequestServices.GetService() ?? base.GetRecurringJobManagerV2(); + } } } diff --git a/src/Hangfire.AspNetCore/packages.lock.json b/src/Hangfire.AspNetCore/packages.lock.json index 4f1bccfce..65bd02068 100644 --- a/src/Hangfire.AspNetCore/packages.lock.json +++ b/src/Hangfire.AspNetCore/packages.lock.json @@ -2047,6 +2047,7 @@ "Microsoft.CodeAnalysis.NetAnalyzers": "[8.0.0, )", "Microsoft.SourceLink.GitHub": "[8.0.0, )", "MoreLinq.Source.MoreEnumerable.Pairwise": "[1.0.1, )", + "NETStandard.Library": "[1.6.1, )", "Newtonsoft.Json": "[9.0.1, )", "StackTraceFormatter.Source": "[1.1.0, )", "StackTraceParser.Source": "[1.3.0, )", @@ -2061,7 +2062,8 @@ "Microsoft.CodeAnalysis.NetAnalyzers": "[8.0.0, )", "Microsoft.Extensions.DependencyInjection.Abstractions": "[1.0.0, )", "Microsoft.Extensions.Logging.Abstractions": "[1.0.0, )", - "Microsoft.SourceLink.GitHub": "[8.0.0, )" + "Microsoft.SourceLink.GitHub": "[8.0.0, )", + "NETStandard.Library": "[1.6.1, )" } } }, diff --git a/src/Hangfire.Core/Dashboard/Content/resx/Strings.Designer.cs b/src/Hangfire.Core/Dashboard/Content/resx/Strings.Designer.cs index 881a05478..a00d47551 100644 --- a/src/Hangfire.Core/Dashboard/Content/resx/Strings.Designer.cs +++ b/src/Hangfire.Core/Dashboard/Content/resx/Strings.Designer.cs @@ -195,6 +195,24 @@ public static string Common_Deleting { } } + /// + /// Looks up a localized string similar to Disable. + /// + public static string Common_Disable { + get { + return ResourceManager.GetString("Common_Disable", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Do you really want to DISABLE ALL selected jobs?. + /// + public static string Common_DisableConfirm { + get { + return ResourceManager.GetString("Common_DisableConfirm", resourceCulture); + } + } + /// /// Looks up a localized string similar to Disabled. /// @@ -204,6 +222,51 @@ public static string Common_Disabled { } } + /// + /// Looks up a localized string similar to Disabling.... + /// + public static string Common_Disabling { + get { + return ResourceManager.GetString("Common_Disabling", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Enable. + /// + public static string Common_Enable { + get { + return ResourceManager.GetString("Common_Enable", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Do you really want to ENABLE ALL selected jobs?. + /// + public static string Common_EnableConfirm { + get { + return ResourceManager.GetString("Common_EnableConfirm", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Enabled. + /// + public static string Common_Enabled { + get { + return ResourceManager.GetString("Common_Enabled", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Enabling.... + /// + public static string Common_Enabling { + get { + return ResourceManager.GetString("Common_Enabling", resourceCulture); + } + } + /// /// Looks up a localized string similar to Enqueue jobs. /// diff --git a/src/Hangfire.Core/Dashboard/Content/resx/Strings.resx b/src/Hangfire.Core/Dashboard/Content/resx/Strings.resx index fff592276..2bf14baf8 100644 --- a/src/Hangfire.Core/Dashboard/Content/resx/Strings.resx +++ b/src/Hangfire.Core/Dashboard/Content/resx/Strings.resx @@ -578,4 +578,25 @@ Log File(s) Used (MB) + + Disable + + + Enable + + + Enabled + + + Disabling... + + + Enabling... + + + Do you really want to DISABLE ALL selected jobs? + + + Do you really want to ENABLE ALL selected jobs? + \ No newline at end of file diff --git a/src/Hangfire.Core/Dashboard/DashboardContext.cs b/src/Hangfire.Core/Dashboard/DashboardContext.cs index 679d0f248..41df5e1f4 100644 --- a/src/Hangfire.Core/Dashboard/DashboardContext.cs +++ b/src/Hangfire.Core/Dashboard/DashboardContext.cs @@ -59,5 +59,10 @@ public virtual IRecurringJobManager GetRecurringJobManager() JobFilterProviders.Providers, Options.TimeZoneResolver ?? new DefaultTimeZoneResolver()); } + + public virtual IRecurringJobManagerV2 GetRecurringJobManagerV2() + { + return (IRecurringJobManagerV2)GetRecurringJobManager(); + } } } \ No newline at end of file diff --git a/src/Hangfire.Core/Dashboard/DashboardRoutes.cs b/src/Hangfire.Core/Dashboard/DashboardRoutes.cs index 897b6c37d..7dcb55f3a 100644 --- a/src/Hangfire.Core/Dashboard/DashboardRoutes.cs +++ b/src/Hangfire.Core/Dashboard/DashboardRoutes.cs @@ -172,6 +172,14 @@ static DashboardRoutes() Routes.AddRecurringBatchCommand( "/recurring/trigger", static (manager, jobId) => manager.Trigger(jobId)); + + Routes.AddRecurringBatchCommandV2( + "/recurring/disable", + static (manager, jobId) => manager.DisableIfExists(jobId)); + + Routes.AddRecurringBatchCommandV2( + "/recurring/enable", + static (manager, jobId) => manager.EnableIfExists(jobId)); Routes.AddRazorPage("/servers", static _ => new ServersPage()); Routes.AddRazorPage("/retries", static _ => new RetriesPage()); diff --git a/src/Hangfire.Core/Dashboard/Pages/RecurringJobsPage.cshtml b/src/Hangfire.Core/Dashboard/Pages/RecurringJobsPage.cshtml index c89e8ad73..114018510 100644 --- a/src/Hangfire.Core/Dashboard/Pages/RecurringJobsPage.cshtml +++ b/src/Hangfire.Core/Dashboard/Pages/RecurringJobsPage.cshtml @@ -68,6 +68,28 @@ @Strings.Common_Delete } + @if (!IsReadOnly) + { + + } + @if (!IsReadOnly) + { + + } @if (pager != null) { @: @Html.PerPageSelector(pager) @@ -116,7 +138,7 @@ { RecurringJobEntity.ParseCronExpression(job.Cron); } - catch (Exception ex) when (ex.IsCatchableExceptionType()) + catch (Exception ex) { cronDescription = ex.Message; cronError = true; @@ -163,7 +185,7 @@ var resolver = DashboardOptions.TimeZoneResolver ?? new DefaultTimeZoneResolver(); displayName = resolver.GetTimeZoneById(job.TimeZoneId).DisplayName; } - catch (Exception ex) when (ex.IsCatchableExceptionType()) + catch (Exception ex) { displayName = null; exception = ex; diff --git a/src/Hangfire.Core/Dashboard/Pages/RecurringJobsPage.cshtml.cs b/src/Hangfire.Core/Dashboard/Pages/RecurringJobsPage.cshtml.cs index 2a819ea35..9cf438bec 100644 --- a/src/Hangfire.Core/Dashboard/Pages/RecurringJobsPage.cshtml.cs +++ b/src/Hangfire.Core/Dashboard/Pages/RecurringJobsPage.cshtml.cs @@ -278,6 +278,128 @@ public override void Execute() #line 71 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + if (!IsReadOnly) + { + + + #line default + #line hidden +WriteLiteral(" \r\n"); + + + + #line 81 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + } + + + #line default + #line hidden + + + #line 82 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + if (!IsReadOnly) + { + + + #line default + #line hidden +WriteLiteral(" \r\n"); + + + + #line 92 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + } + + + #line default + #line hidden + + + #line 93 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" if (pager != null) { @@ -290,7 +412,7 @@ public override void Execute() - #line 73 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 95 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" Write(Html.PerPageSelector(pager)); @@ -300,7 +422,7 @@ public override void Execute() - #line 74 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 96 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" } @@ -312,7 +434,7 @@ public override void Execute() - #line 81 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 103 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" if (!IsReadOnly) { @@ -325,7 +447,7 @@ public override void Execute() - #line 86 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 108 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" } @@ -335,7 +457,7 @@ public override void Execute() - #line 87 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 109 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" Write(Strings.Common_Id); @@ -345,7 +467,7 @@ public override void Execute() - #line 88 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 110 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" Write(Strings.RecurringJobsPage_Table_Cron); @@ -355,7 +477,7 @@ public override void Execute() - #line 89 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 111 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" Write(Strings.RecurringJobsPage_Table_TimeZone); @@ -365,7 +487,7 @@ public override void Execute() - #line 90 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 112 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" Write(Strings.Common_Job); @@ -375,7 +497,7 @@ public override void Execute() - #line 91 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 113 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" Write(Strings.RecurringJobsPage_Table_NextExecution); @@ -385,7 +507,7 @@ public override void Execute() - #line 92 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 114 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" Write(Strings.RecurringJobsPage_Table_LastExecution); @@ -395,7 +517,7 @@ public override void Execute() - #line 93 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 115 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" Write(Strings.Common_Created); @@ -406,7 +528,7 @@ public override void Execute() - #line 97 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 119 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" foreach (var job in recurringJobs) { @@ -417,7 +539,7 @@ public override void Execute() - #line 100 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 122 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" if (!IsReadOnly) { @@ -428,7 +550,7 @@ public override void Execute() - #line 102 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 124 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" Write(job.Error != null ? "2" : "1"); @@ -439,7 +561,7 @@ public override void Execute() - #line 103 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 125 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" Write(job.Id); @@ -449,7 +571,7 @@ public override void Execute() - #line 105 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 127 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" } @@ -459,7 +581,7 @@ public override void Execute() - #line 106 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 128 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" Write(job.Id); @@ -474,7 +596,7 @@ public override void Execute() - #line 109 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 131 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" string cronDescription = null; bool cronError = false; @@ -485,7 +607,7 @@ public override void Execute() { RecurringJobEntity.ParseCronExpression(job.Cron); } - catch (Exception ex) when (ex.IsCatchableExceptionType()) + catch (Exception ex) { cronDescription = ex.Message; cronError = true; @@ -513,7 +635,7 @@ public override void Execute() - #line 140 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 162 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" if (cronDescription != null) { @@ -524,7 +646,7 @@ public override void Execute() - #line 142 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 164 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" Write(cronDescription); @@ -534,7 +656,7 @@ public override void Execute() - #line 143 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 165 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" if (cronError) { @@ -546,7 +668,7 @@ public override void Execute() - #line 146 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 168 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" } @@ -556,7 +678,7 @@ public override void Execute() - #line 147 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 169 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" Write(job.Cron); @@ -566,7 +688,7 @@ public override void Execute() - #line 149 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 171 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" } else { @@ -578,7 +700,7 @@ public override void Execute() - #line 152 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 174 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" Write(job.Cron); @@ -588,7 +710,7 @@ public override void Execute() - #line 153 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 175 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" } @@ -599,7 +721,7 @@ public override void Execute() - #line 156 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 178 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" if (!String.IsNullOrWhiteSpace(job.TimeZoneId)) { string displayName; @@ -610,7 +732,7 @@ public override void Execute() var resolver = DashboardOptions.TimeZoneResolver ?? new DefaultTimeZoneResolver(); displayName = resolver.GetTimeZoneById(job.TimeZoneId).DisplayName; } - catch (Exception ex) when (ex.IsCatchableExceptionType()) + catch (Exception ex) { displayName = null; exception = ex; @@ -624,7 +746,7 @@ public override void Execute() - #line 172 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 194 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" Write(displayName); @@ -634,7 +756,7 @@ public override void Execute() - #line 172 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 194 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" Write(job.TimeZoneId); @@ -644,7 +766,7 @@ public override void Execute() - #line 173 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 195 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" if (exception != null) { @@ -656,7 +778,7 @@ public override void Execute() - #line 175 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 197 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" Write(exception.Message); @@ -666,7 +788,7 @@ public override void Execute() - #line 176 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 198 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" } @@ -676,7 +798,7 @@ public override void Execute() - #line 178 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 200 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" } else { @@ -690,7 +812,7 @@ public override void Execute() - #line 182 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 204 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" } @@ -701,7 +823,7 @@ public override void Execute() - #line 185 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 207 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" if (job.Job != null) { @@ -714,7 +836,7 @@ public override void Execute() - #line 187 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 209 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" Write(Html.JobName(job.Job)); @@ -724,7 +846,7 @@ public override void Execute() - #line 188 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 210 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" } else if (job.LoadException != null && job.LoadException.InnerException != null) { @@ -736,7 +858,7 @@ public override void Execute() - #line 191 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 213 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" Write(job.LoadException.InnerException.Message); @@ -746,7 +868,7 @@ public override void Execute() - #line 192 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 214 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" } else if (job.LoadException != null) { @@ -758,7 +880,7 @@ public override void Execute() - #line 195 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 217 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" Write(job.LoadException.Message); @@ -768,7 +890,7 @@ public override void Execute() - #line 196 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 218 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" } else { @@ -780,7 +902,7 @@ public override void Execute() - #line 199 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 221 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" Write(Strings.Common_NotAvailable); @@ -790,7 +912,7 @@ public override void Execute() - #line 200 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 222 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" } @@ -801,7 +923,7 @@ public override void Execute() - #line 203 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 225 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" if (!job.NextExecution.HasValue) { if (job.Error != null) @@ -815,7 +937,7 @@ public override void Execute() - #line 207 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 229 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" Write(Strings.Common_Error); @@ -825,7 +947,7 @@ public override void Execute() - #line 208 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 230 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" } else { @@ -838,7 +960,7 @@ public override void Execute() - #line 211 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 233 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" Write(Strings.RecurringJobsPage_RecurringJobDisabled_Tooltip); @@ -848,7 +970,7 @@ public override void Execute() - #line 211 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 233 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" Write(Strings.Common_Disabled); @@ -858,7 +980,7 @@ public override void Execute() - #line 212 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 234 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" } } @@ -872,7 +994,7 @@ public override void Execute() - #line 217 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 239 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" Write(Html.RelativeTime(job.NextExecution.Value)); @@ -882,7 +1004,7 @@ public override void Execute() - #line 218 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 240 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" } else { @@ -891,14 +1013,14 @@ public override void Execute() #line default #line hidden - #line 221 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 243 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" Write(Html.RelativeTime(job.NextExecution.Value)); #line default #line hidden - #line 221 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 243 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" } @@ -910,7 +1032,7 @@ public override void Execute() - #line 225 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 247 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" if (job.LastExecution != null) { if (!String.IsNullOrEmpty(job.LastJobId)) @@ -923,7 +1045,7 @@ public override void Execute() - #line 229 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 251 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" Write(Url.JobDetails(job.LastJobId)); @@ -933,7 +1055,7 @@ public override void Execute() - #line 230 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 252 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" var cssSuffix = JobHistoryRenderer.GetStateCssSuffix(job.LastJobState ?? EnqueuedState.StateName); @@ -943,7 +1065,7 @@ public override void Execute() #line hidden - #line 233 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 255 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" if (cssSuffix != null) { @@ -955,7 +1077,7 @@ public override void Execute() - #line 235 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 257 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" Write(cssSuffix); @@ -965,7 +1087,7 @@ public override void Execute() - #line 236 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 258 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" Write(Html.RelativeTime(job.LastExecution.Value)); @@ -975,7 +1097,7 @@ public override void Execute() - #line 238 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 260 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" } else { @@ -988,7 +1110,7 @@ public override void Execute() - #line 241 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 263 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" Write($"background-color: {JobHistoryRenderer.GetForegroundStateColor(job.LastJobState ?? EnqueuedState.StateName)};"); @@ -998,7 +1120,7 @@ public override void Execute() - #line 242 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 264 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" Write(Html.RelativeTime(job.LastExecution.Value)); @@ -1008,7 +1130,7 @@ public override void Execute() - #line 244 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 266 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" } @@ -1018,7 +1140,7 @@ public override void Execute() - #line 246 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 268 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" } else { @@ -1031,7 +1153,7 @@ public override void Execute() - #line 250 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 272 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" Write(Strings.RecurringJobsPage_Canceled); @@ -1041,7 +1163,7 @@ public override void Execute() - #line 250 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 272 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" Write(Html.RelativeTime(job.LastExecution.Value)); @@ -1051,7 +1173,7 @@ public override void Execute() - #line 252 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 274 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" } } else @@ -1064,7 +1186,7 @@ public override void Execute() - #line 256 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 278 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" Write(Strings.Common_NotAvailable); @@ -1074,7 +1196,7 @@ public override void Execute() - #line 257 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 279 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" } @@ -1085,7 +1207,7 @@ public override void Execute() - #line 260 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 282 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" if (job.CreatedAt != null) { @@ -1093,14 +1215,14 @@ public override void Execute() #line default #line hidden - #line 262 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 284 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" Write(Html.RelativeTime(job.CreatedAt.Value)); #line default #line hidden - #line 262 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 284 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" } else @@ -1113,7 +1235,7 @@ public override void Execute() - #line 267 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 289 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" } @@ -1123,7 +1245,7 @@ public override void Execute() - #line 269 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 291 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" if (job.Error != null) { @@ -1135,7 +1257,7 @@ public override void Execute() - #line 272 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 294 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" Write(IsReadOnly ? "6" : "7"); @@ -1146,7 +1268,7 @@ public override void Execute() - #line 273 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 295 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" Write(Html.StackTrace(job.Error)); @@ -1157,7 +1279,7 @@ public override void Execute() - #line 276 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 298 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" } @@ -1167,7 +1289,7 @@ public override void Execute() - #line 278 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 300 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" } @@ -1178,7 +1300,7 @@ public override void Execute() - #line 283 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 305 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" if (pager != null) { @@ -1191,7 +1313,7 @@ public override void Execute() - #line 285 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 307 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" Write(Html.Paginator(pager)); @@ -1201,7 +1323,7 @@ public override void Execute() - #line 286 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 308 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" } @@ -1211,7 +1333,7 @@ public override void Execute() - #line 288 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" + #line 310 "..\..\Dashboard\Pages\RecurringJobsPage.cshtml" } diff --git a/src/Hangfire.Core/Dashboard/RouteCollectionExtensions.cs b/src/Hangfire.Core/Dashboard/RouteCollectionExtensions.cs index 09d791494..394b75c88 100644 --- a/src/Hangfire.Core/Dashboard/RouteCollectionExtensions.cs +++ b/src/Hangfire.Core/Dashboard/RouteCollectionExtensions.cs @@ -115,6 +115,20 @@ public static void AddRecurringBatchCommand( command(manager, jobId); }); } + + public static void AddRecurringBatchCommandV2( + this RouteCollection routes, + string pathTemplate, + [NotNull] Action command) + { + if (command == null) throw new ArgumentNullException(nameof(command)); + + routes.AddBatchCommand(pathTemplate, (context, jobId) => + { + var manager = context.GetRecurringJobManagerV2(); + command(manager, jobId); + }); + } [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("For binary compatibility only. Use overload with Action instead.")] diff --git a/src/Hangfire.Core/IRecurringJobManager.cs b/src/Hangfire.Core/IRecurringJobManager.cs index 6a91bea2d..fdef8bb77 100644 --- a/src/Hangfire.Core/IRecurringJobManager.cs +++ b/src/Hangfire.Core/IRecurringJobManager.cs @@ -25,6 +25,9 @@ public interface IRecurringJobManagerV2 : IRecurringJobManager [CanBeNull] string TriggerJob([NotNull] string recurringJobId); + void DisableIfExists([NotNull] string recurringJobId); + void EnableIfExists([NotNull] string recurringJobId); + void RescheduleIfExists([NotNull] string recurringJobId, [NotNull] string cronExpression); } public interface IRecurringJobManager diff --git a/src/Hangfire.Core/RecurringJob.cs b/src/Hangfire.Core/RecurringJob.cs index 0666d0473..93a71cd91 100644 --- a/src/Hangfire.Core/RecurringJob.cs +++ b/src/Hangfire.Core/RecurringJob.cs @@ -625,6 +625,21 @@ public static void RemoveIfExists([NotNull] string recurringJobId) Instance.Value.RemoveIfExists(recurringJobId); } + public static void DisableIfExists([NotNull] string recurringJobId) + { + Instance.Value.DisableIfExists(recurringJobId); + } + + public static void EnableIfExists([NotNull] string recurringJobId) + { + Instance.Value.EnableIfExists(recurringJobId); + } + + public static void RescheduleIfExists([NotNull] string recurringJobId, [NotNull] string cronExpression) + { + Instance.Value.RescheduleIfExists(recurringJobId, cronExpression); + } + [Obsolete("Please use the TriggerJob method instead. Will be removed in 2.0.0.")] public static void Trigger([NotNull] string recurringJobId) { diff --git a/src/Hangfire.Core/RecurringJobEntity.cs b/src/Hangfire.Core/RecurringJobEntity.cs index 28036cc30..7ae13a916 100644 --- a/src/Hangfire.Core/RecurringJobEntity.cs +++ b/src/Hangfire.Core/RecurringJobEntity.cs @@ -109,6 +109,11 @@ public RecurringJobEntity( { Error = error; } + + if (recurringJob.TryGetValue("Enabled", out var enabled) && !String.IsNullOrWhiteSpace(enabled)) + { + Enabled = bool.Parse(enabled); + } } public string RecurringJobId { get; } @@ -127,7 +132,7 @@ public RecurringJobEntity( public int? Version { get; private set; } public int RetryAttempt { get; set; } public string Error { get; set; } - public bool Disabled { get; set; } + public bool Enabled { get; set; } = true; public void ScheduleNext(ITimeZoneResolver timeZoneResolver, DateTime from) { @@ -275,6 +280,11 @@ private IReadOnlyDictionary GetChangedFields(DateTime now) } } + if ((_recurringJob.TryGetValue("Enabled", out var enabled) ? enabled : "True") != Enabled.ToString()) + { + result.Add("Enabled", enabled); + } + return result; } diff --git a/src/Hangfire.Core/RecurringJobManager.cs b/src/Hangfire.Core/RecurringJobManager.cs index ee72677e1..34d8c8ced 100644 --- a/src/Hangfire.Core/RecurringJobManager.cs +++ b/src/Hangfire.Core/RecurringJobManager.cs @@ -135,7 +135,7 @@ public void AddOrUpdate(string recurringJobId, Job job, string cronExpression, R recurringJob.MisfireHandling = options.MisfireHandling; recurringJob.RetryAttempt = 0; - if (scheduleChanged || recurringJob.Error != null) + if ((scheduleChanged || recurringJob.Error != null) && recurringJob.Enabled) { recurringJob.ScheduleNext(_timeZoneResolver, now.AddSeconds(-1)); } @@ -183,6 +183,8 @@ public string TriggerJob(string recurringJobId) var recurringJob = connection.GetRecurringJob(recurringJobId); if (recurringJob == null) return null; + if (!recurringJob.Enabled) return null; + BackgroundJob backgroundJob; try @@ -223,6 +225,93 @@ public string TriggerJob(string recurringJobId) } } + public void DisableIfExists(string recurringJobId) + { + ToggleEnabledIfExists(recurringJobId, false); + } + + public void EnableIfExists(string recurringJobId) + { + ToggleEnabledIfExists(recurringJobId, true); + } + + internal void ToggleEnabledIfExists(string recurringJobId, bool enabled) + { + if (recurringJobId == null) throw new ArgumentNullException(nameof(recurringJobId)); + + using (var connection = _storage.GetConnection()) + using (connection.AcquireDistributedRecurringJobLock(recurringJobId, DefaultTimeout)) + { + var now = _nowFactory(); + var recurringJob = connection.GetRecurringJob(recurringJobId); + + if (recurringJob is null) return; + + recurringJob.RetryAttempt = 0; + recurringJob.Enabled = enabled; + + switch (enabled) + { + case true: + recurringJob.ScheduleNext(_timeZoneResolver, now); + break; + case false: + recurringJob.Disable(null); + break; + } + + if (recurringJob.IsChanged(now, out var changedFields)) + { + using (var transaction = connection.CreateWriteTransaction()) + { + transaction.UpdateRecurringJob(recurringJob, changedFields, _logger); + transaction.Commit(); + } + } + } + } + + public void RescheduleIfExists(string recurringJobId, string cronExpression) + { + if (recurringJobId == null) throw new ArgumentNullException(nameof(recurringJobId)); + if (cronExpression == null) throw new ArgumentNullException(nameof(cronExpression)); + + ValidateCronExpression(cronExpression); + + using (var connection = _storage.GetConnection()) + using (connection.AcquireDistributedRecurringJobLock(recurringJobId, DefaultTimeout)) + { + var now = _nowFactory(); + var recurringJob = connection.GetRecurringJob(recurringJobId); + + if (recurringJob is null) return; + + var scheduleChanged = false; + + if (!cronExpression.Equals(recurringJob.Cron, StringComparison.OrdinalIgnoreCase)) + { + recurringJob.Cron = cronExpression; + scheduleChanged = true; + } + + recurringJob.RetryAttempt = 0; + + if (scheduleChanged || recurringJob.Error != null) + { + recurringJob.ScheduleNext(_timeZoneResolver, now.AddSeconds(-1)); + } + + if (recurringJob.IsChanged(now, out var changedFields)) + { + using (var transaction = connection.CreateWriteTransaction()) + { + transaction.UpdateRecurringJob(recurringJob, changedFields, _logger); + transaction.Commit(); + } + } + } + } + public void RemoveIfExists(string recurringJobId) { if (recurringJobId == null) throw new ArgumentNullException(nameof(recurringJobId)); diff --git a/src/Hangfire.Core/Server/RecurringJobScheduler.cs b/src/Hangfire.Core/Server/RecurringJobScheduler.cs index 010a86869..0ff447eb9 100644 --- a/src/Hangfire.Core/Server/RecurringJobScheduler.cs +++ b/src/Hangfire.Core/Server/RecurringJobScheduler.cs @@ -293,6 +293,11 @@ private void TryEnqueueBackgroundJob( return; } + if (!recurringJob.Enabled) + { + return; + } + ScheduleRecurringJob(context, connection, recurringJobId, recurringJob, now); } } diff --git a/src/Hangfire.NetCore/packages.lock.json b/src/Hangfire.NetCore/packages.lock.json index aec4ca1f5..8a3194ce0 100644 --- a/src/Hangfire.NetCore/packages.lock.json +++ b/src/Hangfire.NetCore/packages.lock.json @@ -1273,6 +1273,7 @@ "Microsoft.CodeAnalysis.NetAnalyzers": "[8.0.0, )", "Microsoft.SourceLink.GitHub": "[8.0.0, )", "MoreLinq.Source.MoreEnumerable.Pairwise": "[1.0.1, )", + "NETStandard.Library": "[1.6.1, )", "Newtonsoft.Json": "[9.0.1, )", "StackTraceFormatter.Source": "[1.1.0, )", "StackTraceParser.Source": "[1.3.0, )", diff --git a/src/Hangfire.SqlServer/packages.lock.json b/src/Hangfire.SqlServer/packages.lock.json index cefee266a..544af2c85 100644 --- a/src/Hangfire.SqlServer/packages.lock.json +++ b/src/Hangfire.SqlServer/packages.lock.json @@ -1281,6 +1281,7 @@ "Microsoft.CodeAnalysis.NetAnalyzers": "[8.0.0, )", "Microsoft.SourceLink.GitHub": "[8.0.0, )", "MoreLinq.Source.MoreEnumerable.Pairwise": "[1.0.1, )", + "NETStandard.Library": "[1.6.1, )", "Newtonsoft.Json": "[9.0.1, )", "StackTraceFormatter.Source": "[1.1.0, )", "StackTraceParser.Source": "[1.3.0, )", From af4a42659e3b06a743471041669f898600b1bbe6 Mon Sep 17 00:00:00 2001 From: DCarlson12 Date: Thu, 15 Aug 2024 01:26:07 -0400 Subject: [PATCH 3/3] Remove missing project --- Hangfire.sln | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/Hangfire.sln b/Hangfire.sln index c5afcfc69..196776fee 100644 --- a/Hangfire.sln +++ b/Hangfire.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.28307.136 +# Visual Studio Version 17 +VisualStudioVersion = 17.11.35208.52 MinimumVisualStudioVersion = 10.0.40219.1 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConsoleSample", "samples\ConsoleSample\ConsoleSample.csproj", "{C02BB718-2AE4-434C-8668-C894FF663FCE}" EndProject @@ -19,9 +19,9 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{15E186DF-8918-44F1-9285-9756EDAECA5D}" ProjectSection(SolutionItems) = preProject appveyor.yml = appveyor.yml + src\Directory.Build.props = src\Directory.Build.props psake-project.ps1 = psake-project.ps1 src\SharedAssemblyInfo.cs = src\SharedAssemblyInfo.cs - src\Directory.Build.props = src\Directory.Build.props EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "nuspecs", "nuspecs", "{5E687025-A525-4534-8869-CB685C7B11C4}" @@ -56,9 +56,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Hangfire.AspNetCore", "src\ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetCoreSample", "samples\NetCoreSample\NetCoreSample.csproj", "{FA751692-20C8-4986-8164-D21F505B2172}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Hangfire.NetCore", "src\Hangfire.NetCore\Hangfire.NetCore.csproj", "{AA8E3A67-8731-423A-9B69-EE44EC6B8E1A}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MinimalApiSample", "samples\MinimalApiSample\MinimalApiSample.csproj", "{BB3A67A7-BDC8-4B27-85F4-EE3B27C33F61}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Hangfire.NetCore", "src\Hangfire.NetCore\Hangfire.NetCore.csproj", "{AA8E3A67-8731-423A-9B69-EE44EC6B8E1A}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -106,10 +104,6 @@ Global {AA8E3A67-8731-423A-9B69-EE44EC6B8E1A}.Debug|Any CPU.Build.0 = Debug|Any CPU {AA8E3A67-8731-423A-9B69-EE44EC6B8E1A}.Release|Any CPU.ActiveCfg = Release|Any CPU {AA8E3A67-8731-423A-9B69-EE44EC6B8E1A}.Release|Any CPU.Build.0 = Release|Any CPU - {BB3A67A7-BDC8-4B27-85F4-EE3B27C33F61}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BB3A67A7-BDC8-4B27-85F4-EE3B27C33F61}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BB3A67A7-BDC8-4B27-85F4-EE3B27C33F61}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BB3A67A7-BDC8-4B27-85F4-EE3B27C33F61}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -120,7 +114,6 @@ Global {6DFFA275-C483-4501-823A-741AC9EC0846} = {766BE831-F758-46BC-AFD3-BBEEFE0F686F} {DBC6BC12-06AD-4597-9E0F-B77BE754FA2C} = {766BE831-F758-46BC-AFD3-BBEEFE0F686F} {FA751692-20C8-4986-8164-D21F505B2172} = {119DA7FA-B94C-4B63-AEC9-428EF834E0D8} - {BB3A67A7-BDC8-4B27-85F4-EE3B27C33F61} = {119DA7FA-B94C-4B63-AEC9-428EF834E0D8} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {7597454C-C272-4016-87A2-CF1196347355}