Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
TakeStock
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pengjinyang
TakeStock
Commits
8d228115
Commit
8d228115
authored
Sep 20, 2019
by
pengjinyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交
parent
2150d193
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
Startup.cs
TakeStock.API/Startup.cs
+7
-4
TakeStock.API.csproj
TakeStock.API/TakeStock.API.csproj
+2
-1
No files found.
TakeStock.API/Startup.cs
View file @
8d228115
...
...
@@ -4,6 +4,7 @@ using Domain.TakeStock.Repository;
using
EasyNetQ
;
using
EasyNetQ.AutoSubscribe
;
using
Hangfire
;
using
Hangfire.MemoryStorage
;
using
Hangfire.MySql
;
using
IService.TakeStock
;
using
MessageQueue
;
...
...
@@ -32,11 +33,11 @@ namespace TakeStock.API
public
Startup
(
IConfiguration
configuration
)
{
Configuration
=
configuration
;
Redis
=
ConnectionMultiplexer
.
Connect
(
Configuration
.
GetConnectionString
(
"Redis"
));
//
Redis = ConnectionMultiplexer.Connect(Configuration.GetConnectionString("Redis"));
}
public
IConfiguration
Configuration
{
get
;
}
public
static
ConnectionMultiplexer
Redis
;
//
public static ConnectionMultiplexer Redis;
// This method gets called by the runtime. Use this method to add services to the container.
public
void
ConfigureServices
(
IServiceCollection
services
)
...
...
@@ -73,7 +74,10 @@ namespace TakeStock.API
services
.
AddHttpClient
();
// Add Hangfire services.
services
.
AddHangfire
(
configuration
=>
configuration
.
UseRedisStorage
(
Redis
));
services
.
AddHangfire
(
config
=>
{
config
.
UseMemoryStorage
();
});
// Add the processing server as IHostedService
services
.
AddHangfireServer
();
...
...
@@ -111,7 +115,6 @@ namespace TakeStock.API
//dbContext.Migration();
//app.UseSubscribe("TakeStockService", AppDomain.CurrentDomain.GetAssemblies().Single(a => a.GetName().Name == "Service"));
}
public
void
RegisterHttpClient
(
IServiceCollection
services
)
...
...
TakeStock.API/TakeStock.API.csproj
View file @
8d228115
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
...
...
@@ -13,6 +13,7 @@
<PackageReference Include="Hangfire.AspNetCore" Version="1.7.3" />
<PackageReference Include="Hangfire.Dashboard.Authorization" Version="2.1.0" />
<PackageReference Include="Hangfire.Dashboard.Dark" Version="1.0.6" />
<PackageReference Include="Hangfire.MemoryStorage" Version="1.6.3" />
<PackageReference Include="Hangfire.MySqlStorage" Version="2.0.0" />
<PackageReference Include="Hangfire.Redis.StackExchange" Version="1.8.0" />
<PackageReference Include="Microsoft.AspNetCore.App" />
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment