Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
CAP
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
tsai
CAP
Commits
730507d0
Commit
730507d0
authored
Aug 14, 2017
by
yangxiaodong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed issue #25.
parent
c4a465cd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
CapPublisherBase.cs
src/DotNetCore.CAP/Abstractions/CapPublisherBase.cs
+14
-1
No files found.
src/DotNetCore.CAP/Abstractions/CapPublisherBase.cs
View file @
730507d0
...
...
@@ -12,9 +12,10 @@ namespace DotNetCore.CAP.Abstractions
protected
IDbConnection
DbConnection
{
get
;
set
;
}
protected
IDbTransaction
DbTranasaction
{
get
;
set
;
}
protected
bool
IsCapOpenedTrans
{
get
;
set
;
}
protected
bool
IsCapOpenedConn
{
get
;
set
;
}
protected
bool
IsUsingEF
{
get
;
set
;
}
protected
IServiceProvider
ServiceProvider
{
get
;
set
;
}
public
void
Publish
<
T
>(
string
name
,
T
contentObj
)
{
CheckIsUsingEF
(
name
);
...
...
@@ -83,7 +84,10 @@ namespace DotNetCore.CAP.Abstractions
throw
new
ArgumentNullException
(
nameof
(
dbConnection
));
if
(
dbConnection
.
State
!=
ConnectionState
.
Open
)
{
IsCapOpenedConn
=
true
;
dbConnection
.
Open
();
}
if
(
dbTransaction
==
null
)
{
...
...
@@ -122,8 +126,13 @@ namespace DotNetCore.CAP.Abstractions
{
dbTransaction
.
Commit
();
dbTransaction
.
Dispose
();
}
if
(
IsCapOpenedConn
)
{
dbConnection
.
Dispose
();
}
PublishQueuer
.
PulseEvent
.
Set
();
}
...
...
@@ -142,8 +151,12 @@ namespace DotNetCore.CAP.Abstractions
{
dbTransaction
.
Commit
();
dbTransaction
.
Dispose
();
}
if
(
IsCapOpenedConn
)
{
dbConnection
.
Dispose
();
}
PublishQueuer
.
PulseEvent
.
Set
();
}
...
...
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