Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wiki-js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
wiki-js
Commits
3092615c
Commit
3092615c
authored
Dec 30, 2019
by
NGPixel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: improve db error reporting for pg
parent
f1725159
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
db.js
server/core/db.js
+6
-1
No files found.
server/core/db.js
View file @
3092615c
...
...
@@ -138,7 +138,11 @@ module.exports = {
WIKI
.
logger
.
info
(
'Database Connection Successful [ OK ]'
)
}
catch
(
err
)
{
if
(
conAttempts
<
10
)
{
WIKI
.
logger
.
error
(
`Database Connection Error:
${
err
.
code
}
${
err
.
address
}
:
${
err
.
port
}
`
)
if
(
err
.
code
)
{
WIKI
.
logger
.
error
(
`Database Connection Error:
${
err
.
code
}
${
err
.
address
}
:
${
err
.
port
}
`
)
}
else
{
WIKI
.
logger
.
error
(
`Database Connection Error:
${
err
.
message
}
`
)
}
WIKI
.
logger
.
warn
(
`Will retry in 3 seconds... [Attempt
${
++
conAttempts
}
of 10]`
)
await
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
3000
))
await
initTasks
.
connect
()
...
...
@@ -170,6 +174,7 @@ module.exports = {
// Perform init tasks
WIKI
.
logger
.
info
(
`Using database driver
${
dbClient
}
for
${
WIKI
.
config
.
db
.
type
}
[ OK ]`
)
this
.
onReady
=
Promise
.
each
(
initTasksQueue
,
t
=>
t
()).
return
(
true
)
return
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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