Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gitlab-eum
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LiU IT - Infrastructure
gitlab-eum
Commits
2f65c5e9
Commit
2f65c5e9
authored
7 years ago
by
Alexander Olofsson
Browse files
Options
Downloads
Patches
Plain Diff
Log database errors
parent
2d6cedac
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
server/db.js
+5
-0
5 additions, 0 deletions
server/db.js
server/users.js
+3
-0
3 additions, 0 deletions
server/users.js
with
8 additions
and
0 deletions
server/db.js
+
5
−
0
View file @
2f65c5e9
...
@@ -5,6 +5,11 @@ const config = require('../config');
...
@@ -5,6 +5,11 @@ const config = require('../config');
const
pool
=
new
Pool
();
const
pool
=
new
Pool
();
pool
.
on
(
'
error
'
,
(
err
)
=>
{
console
.
log
(
"
DB Pool error occured;
"
);
console
.
log
(
err
);
});
// TODO: Figure out the perfect db layout, or get the one from IDA
// TODO: Figure out the perfect db layout, or get the one from IDA
const
seed
=
`
const
seed
=
`
CREATE TABLE IF NOT EXISTS external_users (
CREATE TABLE IF NOT EXISTS external_users (
...
...
This diff is collapsed.
Click to expand it.
server/users.js
+
3
−
0
View file @
2f65c5e9
...
@@ -40,6 +40,9 @@ router.post('/', async (req, res) => {
...
@@ -40,6 +40,9 @@ router.post('/', async (req, res) => {
try
{
try
{
const
queryText
=
'
INSERT INTO external_users(id, owner_id, username, date_added) VALUES($1, $2, $3, NOW())
'
;
const
queryText
=
'
INSERT INTO external_users(id, owner_id, username, date_added) VALUES($1, $2, $3, NOW())
'
;
await
db
.
query
(
queryText
,
[
data
.
id
,
req
.
user
.
id
,
data
.
username
]);
await
db
.
query
(
queryText
,
[
data
.
id
,
req
.
user
.
id
,
data
.
username
]);
}
catch
(
err
)
{
console
.
log
(
"
> DB Error:
"
);
console
.
log
(
err
);
}
}
res
.
send
(
data
);
res
.
send
(
data
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment