Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
public
/
sequelize
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
不要怂,就是干,撸起袖子干!
Commit b903384e
authored
May 25, 2018
by
Maxime Suret
Committed by
Sushant
May 25, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(transactions): return patched promise from sequelize.query (#9473)
1 parent
51797c7b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
lib/sequelize.js
test/integration/cls.test.js
lib/sequelize.js
View file @
b903384
...
...
@@ -451,7 +451,7 @@ class Sequelize {
let
bindParameters
;
return
retry
(
retryParameters
=>
Promise
.
try
(()
=>
{
return
Promise
.
resolve
(
retry
(
retryParameters
=>
Promise
.
try
(()
=>
{
const
isFirstTry
=
retryParameters
.
current
===
1
;
if
(
options
.
instance
&&
!
options
.
model
)
{
...
...
@@ -565,7 +565,7 @@ class Sequelize {
return
this
.
connectionManager
.
releaseConnection
(
connection
);
}
});
}),
retryOptions
);
}),
retryOptions
)
)
;
}
/**
...
...
test/integration/cls.test.js
View file @
b903384
...
...
@@ -164,5 +164,12 @@ if (current.dialect.supports.transactions) {
it
(
'CLS namespace is stored in Sequelize._cls'
,
function
()
{
expect
(
Sequelize
.
_cls
).
to
.
equal
(
this
.
ns
);
});
it
(
'promises returned by sequelize.query are correctly patched'
,
function
()
{
return
this
.
sequelize
.
transaction
(
t
=>
this
.
sequelize
.
query
(
'select 1'
,
{
type
:
Sequelize
.
QueryTypes
.
SELECT
})
.
then
(()
=>
expect
(
this
.
ns
.
get
(
'transaction'
)).
to
.
equal
(
t
))
);
});
});
}
Write
Preview
Markdown
is supported
Attach a file
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 post a comment