Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
m4lab_tv1
Project Page
Commits
192d4184
Commit
192d4184
authored
3 years ago
by
Rosanny Sihombing
Browse files
Options
Download
Email Patches
Plain Diff
using connection pool
parent
d2a5ff3d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
config/dbconn.ts
+10
-11
config/dbconn.ts
with
10 additions
and
11 deletions
+10
-11
config/dbconn.ts
+
10
-
11
View file @
192d4184
...
@@ -4,35 +4,34 @@ var env = process.env.NODE_ENV || 'testing';
...
@@ -4,35 +4,34 @@ var env = process.env.NODE_ENV || 'testing';
const
config
=
require
(
'
./config
'
)[
env
]
const
config
=
require
(
'
./config
'
)[
env
]
// ==== USER ACOOUNT DB CONNECTION ====
// ==== USER ACOOUNT DB CONNECTION ====
var
userConnection
=
mysql
.
create
Connection
({
const
userConnection
=
mysql
.
create
Pool
({
host
:
config
.
database
.
host
,
host
:
config
.
database
.
host
,
user
:
config
.
database
.
user
,
user
:
config
.
database
.
user
,
password
:
config
.
database
.
password
,
password
:
config
.
database
.
password
,
port
:
config
.
database
.
port
,
port
:
config
.
database
.
port
,
database
:
config
.
database
.
dbUser
,
database
:
config
.
database
.
dbUser
,
multipleStatements
:
true
waitForConnections
:
true
,
connectionLimit
:
10
,
queueLimit
:
0
})
})
userConnection
.
connect
(
function
(
err
)
{
if
(
err
)
throw
err
;
})
userConnection
.
query
(
'
USE
'
+
config
.
database
.
dbUser
)
userConnection
.
query
(
'
USE
'
+
config
.
database
.
dbUser
)
// ==== PROJECT DB CONNECTION ====
// ==== PROJECT DB CONNECTION ====
var
projectConnection
=
mysql
.
create
Connection
({
const
projectConnection
=
mysql
.
create
Pool
({
host
:
config
.
database
.
host_project
,
host
:
config
.
database
.
host_project
,
user
:
config
.
database
.
user
,
user
:
config
.
database
.
user
,
password
:
config
.
database
.
password
,
password
:
config
.
database
.
password
,
port
:
config
.
database
.
port
,
port
:
config
.
database
.
port
,
database
:
config
.
database
.
dbProject
database
:
config
.
database
.
dbProject
,
waitForConnections
:
true
,
connectionLimit
:
10
,
queueLimit
:
0
})
})
projectConnection
.
connect
(
function
(
err
)
{
if
(
err
)
throw
err
;
})
projectConnection
.
query
(
'
USE
'
+
config
.
database
.
dbProject
)
projectConnection
.
query
(
'
USE
'
+
config
.
database
.
dbProject
)
var
connection
=
{
const
connection
=
{
user
:
userConnection
,
user
:
userConnection
,
project
:
projectConnection
project
:
projectConnection
}
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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
Menu
Explore
Projects
Groups
Snippets