You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: machines/destroy-manager.js
+27-9Lines changed: 27 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -4,10 +4,7 @@ module.exports = {
4
4
friendlyName: 'Destroy manager',
5
5
6
6
7
-
description: 'Destroy the specified connection manager and destroying all of its active connections.',
8
-
9
-
10
-
extendedDescription: 'This may involve destroying a single connection, destroying a pool and its connections, destroying multiple pools and their connections, or something even more exotic. The implementation is left up to the driver.',
7
+
description: 'Destroy the specified connection manager and destroy all of its active connections.',
11
8
12
9
13
10
inputs: {
@@ -37,9 +34,9 @@ module.exports = {
37
34
}
38
35
},
39
36
40
-
badManager: {
41
-
friendlyName: 'Bad manager',
42
-
description: 'The provided connection manager is no longer active; or possibly never was.',
37
+
failed: {
38
+
friendlyName: 'Failed',
39
+
description: 'Could not destroy the provided connection manager.',
43
40
extendedDescription:
44
41
'Usually, this means the manager has already been destroyed. But depending on the driver '+
45
42
'it could also mean that database cannot be accessed. In production, this can mean that the database '+
@@ -56,8 +53,29 @@ module.exports = {
56
53
57
54
58
55
fn: function(inputs,exits){
59
-
// TODO
60
-
returnexits.error();
56
+
varutil=require('util');
57
+
58
+
// Note that if this driver is adapted to support managers which spawn
59
+
// ad-hoc connections or manage multiple pools/replicas using PoolCluster,
60
+
// then relevant settings would need to be included in the manager instance
61
+
// so that the manager could be appropriately destroyed here (in the case of
62
+
// ad-hoc connections, leased connections would need to be tracked on the
63
+
// manager, and then rounded up and disconnected here.)
64
+
//
65
+
// For now, since we only support a single pool, we simply destroy it.
0 commit comments