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 93e5507d
authored
Mar 05, 2015
by
Mick Hansen
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3285 from mbroadst/mssql-disconnect-issue
fix tedious error handling
2 parents
fcceefdf
421dd28a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
lib/dialects/mssql/connection-manager.js
lib/dialects/mssql/connection-manager.js
View file @
93e5507
...
@@ -47,11 +47,6 @@ ConnectionManager.prototype.connect = function(config) {
...
@@ -47,11 +47,6 @@ ConnectionManager.prototype.connect = function(config) {
var
connection
=
new
self
.
lib
.
Connection
(
connectionConfig
);
var
connection
=
new
self
.
lib
.
Connection
(
connectionConfig
);
connection
.
lib
=
self
.
lib
;
connection
.
lib
=
self
.
lib
;
// don't let tedious errors take down the entire application
connection
.
on
(
'error'
,
function
(
err
)
{
connection
.
_invalid
=
true
;
});
connection
.
on
(
'connect'
,
function
(
err
)
{
connection
.
on
(
'connect'
,
function
(
err
)
{
if
(
!
err
)
{
if
(
!
err
)
{
resolve
(
connection
);
resolve
(
connection
);
...
@@ -93,12 +88,23 @@ ConnectionManager.prototype.connect = function(config) {
...
@@ -93,12 +88,23 @@ ConnectionManager.prototype.connect = function(config) {
break
;
break
;
}
}
});
});
if
(
config
.
pool
.
handleDisconnects
)
{
connection
.
on
(
'error'
,
function
(
err
)
{
switch
(
err
.
code
)
{
case
'ESOCKET'
:
case
'ECONNRESET'
:
self
.
pool
.
destroy
(
connection
);
}
});
}
});
});
};
};
ConnectionManager
.
prototype
.
disconnect
=
function
(
connection
)
{
ConnectionManager
.
prototype
.
disconnect
=
function
(
connection
)
{
// Dont disconnect a connection that is already disconnected
// Dont disconnect a connection that is already disconnected
if
(
!
connection
.
connect
ed
)
{
if
(
!
!
connection
.
clos
ed
)
{
return
Promise
.
resolve
();
return
Promise
.
resolve
();
}
}
...
...
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