updated WelcomeAgents func
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
efc26fb27a
commit
a735f54024
@ -21,13 +21,14 @@ func WelcomeAgents(ws *websocket.Conn, welcome WSWelcome, t string) {
|
|||||||
connectinfo, ok := LISTENERS[welcome.Hostname]
|
connectinfo, ok := LISTENERS[welcome.Hostname]
|
||||||
|
|
||||||
if !ok {
|
if !ok {
|
||||||
if t == "ps" {
|
switch t {
|
||||||
|
case "ps":
|
||||||
connectinfo := ConnectionInfo{
|
connectinfo := ConnectionInfo{
|
||||||
ConnectionPS: ws,
|
ConnectionPS: ws,
|
||||||
InitDate: time.Now(),
|
InitDate: time.Now(),
|
||||||
}
|
}
|
||||||
LISTENERS[welcome.Hostname] = &connectinfo
|
LISTENERS[welcome.Hostname] = &connectinfo
|
||||||
} else if t == "rr" {
|
case "rr":
|
||||||
connectinfo := ConnectionInfo{
|
connectinfo := ConnectionInfo{
|
||||||
ConnectionRR: ws,
|
ConnectionRR: ws,
|
||||||
InitDate: time.Now(),
|
InitDate: time.Now(),
|
||||||
@ -35,9 +36,10 @@ func WelcomeAgents(ws *websocket.Conn, welcome WSWelcome, t string) {
|
|||||||
LISTENERS[welcome.Hostname] = &connectinfo
|
LISTENERS[welcome.Hostname] = &connectinfo
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if t == "ps" {
|
switch t {
|
||||||
|
case "ps":
|
||||||
connectinfo.ConnectionPS = ws
|
connectinfo.ConnectionPS = ws
|
||||||
} else if t == "rr" {
|
case "rr":
|
||||||
connectinfo.ConnectionRR = ws
|
connectinfo.ConnectionRR = ws
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user