Skip to content

Commit

Permalink
Remove hangfire.
Browse files Browse the repository at this point in the history
  • Loading branch information
tymorrow committed Jun 16, 2024
1 parent bf43cde commit 9e02a63
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 109 deletions.
7 changes: 0 additions & 7 deletions src/Dsp.Web/Dsp.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,6 @@
<Reference Include="EntityFramework.SqlServer, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL">
<HintPath>..\packages\EntityFramework.6.2.0\lib\net45\EntityFramework.SqlServer.dll</HintPath>
</Reference>
<Reference Include="Hangfire.Core, Version=1.6.17.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Hangfire.Core.1.6.17\lib\net45\Hangfire.Core.dll</HintPath>
</Reference>
<Reference Include="Hangfire.SqlServer, Version=1.6.17.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Hangfire.SqlServer.1.6.17\lib\net45\Hangfire.SqlServer.dll</HintPath>
</Reference>
<Reference Include="MarkdownSharp, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MarkdownSharp.1.13.0.0\lib\35\MarkdownSharp.dll</HintPath>
<Private>True</Private>
Expand Down Expand Up @@ -291,7 +285,6 @@
<Compile Include="Areas\Service\Models\AddServiceHourAmendmentModel.cs" />
<Compile Include="Areas\Service\Models\ServiceAmendmentModel.cs" />
<Compile Include="Areas\Treasury\TreasuryAreaRegistration.cs" />
<Compile Include="Extensions\ApplicationPreload.cs" />
<Compile Include="Models\BaseViewModel.cs" />
<Compile Include="Models\RecruitmentModel.cs" />
<Compile Include="Models\DonationModel.cs" />
Expand Down
68 changes: 0 additions & 68 deletions src/Dsp.Web/Extensions/ApplicationPreload.cs

This file was deleted.

12 changes: 2 additions & 10 deletions src/Dsp.Web/Global.asax.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
namespace Dsp.Web
{
using Dsp.Data;
using System.Data.Entity;
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using System.Web.Optimization;
using System.Web.Routing;
using Dsp.Data;
using Dsp.Web.Extensions;

public class MvcApplication : HttpApplication
{
Expand All @@ -18,14 +17,7 @@ protected void Application_Start()
GlobalConfiguration.Configure(WebApiConfig.Register);
FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
RouteConfig.RegisterRoutes(RouteTable.Routes);
BundleConfig.RegisterBundles(BundleTable.Bundles);

HangfireBootstrapper.Instance.Start();
}

protected void Application_End()
{
HangfireBootstrapper.Instance.Stop();
BundleConfig.RegisterBundles(BundleTable.Bundles);
}
}
}
20 changes: 1 addition & 19 deletions src/Dsp.Web/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
using Dsp.Web.Extensions;
using Hangfire;
using Hangfire.SqlServer;
using Microsoft.Owin;
using Microsoft.Owin;
using Owin;
using RazorEngine;
using RazorEngine.Templating;
using System;
using System.IO;
using System.Net;
using System.Web.Configuration;

[assembly: OwinStartupAttribute(typeof(Dsp.Web.Startup))]
namespace Dsp.Web
Expand All @@ -23,19 +18,6 @@ public void Configuration(IAppBuilder app)
var template = File.ReadAllText(path);
Engine.Razor.AddTemplate("sse", template);

var options = new SqlServerStorageOptions
{
QueuePollInterval = TimeSpan.FromSeconds(60)
};
var dbConnectionString = WebConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString;
GlobalConfiguration.Configuration.UseSqlServerStorage(dbConnectionString, options);

app.UseHangfireDashboard();
app.UseHangfireServer();

var tz = TimeZoneInfo.FindSystemTimeZoneById("Central Standard Time");
RecurringJob.AddOrUpdate("sober-schedule-email", () => EmailService.TryToSendSoberSchedule(), Cron.Daily(16), tz);

ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/Dsp.Web/Web.config
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</sectionGroup>
</configSections>
<connectionStrings>
<add name="DefaultConnection" connectionString="Data Source=(local);Initial Catalog=dspdb;Integrated Security=True" providerName="System.Data.SqlClient" />
<add name="DefaultConnection" connectionString="Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=dspdb;Integrated Security=True" providerName="System.Data.SqlClient" />
</connectionStrings>
<appSettings>
<add key="webpages:Version" value="3.0.0.0" />
Expand Down Expand Up @@ -67,7 +67,7 @@
</httpModules>
</system.web>
<system.webServer>
<caching enabled="true" enableKernelCache="true" maxCacheSize="1000" maxResponseSize="512000"/>
<caching enabled="true" enableKernelCache="true" maxCacheSize="1000" maxResponseSize="512000" />
<security>
<requestFiltering>
<!-- IIS limits on upload size - 10mb -->
Expand Down
3 changes: 0 additions & 3 deletions src/Dsp.Web/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
<package id="Elmah.MVC" version="2.1.2" targetFramework="net451" />
<package id="EntityFramework" version="6.2.0" targetFramework="net452" />
<package id="FontAwesome" version="4.2.0" targetFramework="net451" />
<package id="Hangfire" version="1.6.17" targetFramework="net452" />
<package id="Hangfire.Core" version="1.6.17" targetFramework="net452" />
<package id="Hangfire.SqlServer" version="1.6.17" targetFramework="net452" />
<package id="jQuery" version="2.1.4" targetFramework="net451" />
<package id="jQuery.UI.Combined" version="1.13.2" targetFramework="net462" />
<package id="jQuery.Validation" version="1.13.1" targetFramework="net451" />
Expand Down

0 comments on commit 9e02a63

Please sign in to comment.