Browse
---
Chat
---
Wekan
Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
os
infra-monitor
Commits
a0f410f2
Commit
a0f410f2
authored
7 years ago
by
kc
Browse files
Options
Download
Email Patches
Plain Diff
Only give consul leader if logged in
parent
fa5f9199
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
docker-compose.yml
+1
-1
docker-compose.yml
server/ws.js
+8
-1
server/ws.js
with
9 additions
and
2 deletions
+9
-2
docker-compose.yml
+
1
-
1
View file @
a0f410f2
...
...
@@ -2,7 +2,7 @@ version: "3"
services
:
main
:
build
:
.
image
:
jestrr/monitor:0.12.
3
image
:
jestrr/monitor:0.12.
4
entrypoint
:
[
"
pm2"
,
"
start"
,
"
/home/app/src/config/pm2.config.js"
,
"
--no-daemon"
]
volumes
:
-
/etc/ssl/creds:/home/app/creds
...
...
This diff is collapsed.
Click to expand it.
server/ws.js
+
8
-
1
View file @
a0f410f2
...
...
@@ -109,7 +109,7 @@ module.exports = {
evt
.
type
===
"
status
"
&&
this
.
getServerStatus
(
chatroom
,
evt
,
ws
);
evt
.
type
===
"
services
"
&&
this
.
checkDataCenters
(
chatroom
,
evt
,
ws
);
evt
.
type
===
"
updateCenters
"
&&
this
.
checkCenters
();
evt
.
type
===
"
getLeader
"
&&
w
s
.
send
(
JSON
.
stringify
({
type
:
"
getLeader
"
,
msg
:
CONSUL_LEADER
}))
evt
.
type
===
"
getLeader
"
&&
thi
s
.
send
Leader
(
chatroom
,
evt
,
ws
);
})
ws
.
on
(
"
close
"
,
(
evt
)
=>
{
let
peerInd
=
connectedPeers
.
findIndex
((
masterPeer
)
=>
masterPeer
.
wsId
===
wsId
)
...
...
@@ -119,6 +119,13 @@ module.exports = {
});
},
sendLeader
:
function
(
chatroom
,
evt
,
ws
)
{
this
.
canSendInfo
(
ws
,
(
canSend
)
=>
{
canSend
&&
ws
.
send
(
JSON
.
stringify
({
type
:
"
getLeader
"
,
msg
:
CONSUL_LEADER
}))
!
canSend
&&
ws
.
send
(
JSON
.
stringify
({
type
:
"
getLeader
"
,
msg
:
""
}))
})
},
getServerStatus
:
function
(
chatroom
,
evt
,
ws
)
{
health
.
getServerStatus
((
apps
)
=>
{
let
response
=
{
type
:
"
status
"
,
apps
:
apps
}
...
...
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