mirror of
https://github.com/fly-apps/live_beats.git
synced 2024-11-21 23:50:59 +00:00
Fix ping on reconnect
This commit is contained in:
parent
95c69a4aa5
commit
409431b1e7
2 changed files with 5 additions and 1 deletions
|
@ -191,6 +191,10 @@ Hooks.Ping = {
|
||||||
})
|
})
|
||||||
this.ping(null)
|
this.ping(null)
|
||||||
},
|
},
|
||||||
|
reconnected(){
|
||||||
|
clearTimeout(this.timer)
|
||||||
|
this.ping(null)
|
||||||
|
},
|
||||||
destroyed(){ clearTimeout(this.timer) },
|
destroyed(){ clearTimeout(this.timer) },
|
||||||
ping(rtt){
|
ping(rtt){
|
||||||
this.nowMs = Date.now()
|
this.nowMs = Date.now()
|
||||||
|
|
|
@ -39,7 +39,7 @@ config :live_beats, LiveBeats.ReplicaRepo,
|
||||||
config :live_beats, LiveBeatsWeb.Endpoint,
|
config :live_beats, LiveBeatsWeb.Endpoint,
|
||||||
# Binding to loopback ipv4 address prevents access from other machines.
|
# Binding to loopback ipv4 address prevents access from other machines.
|
||||||
# Change to `ip: {0, 0, 0, 0}` to allow access from other machines.
|
# Change to `ip: {0, 0, 0, 0}` to allow access from other machines.
|
||||||
http: [ip: {127, 0, 0, 1}, port: 4000],
|
http: [ip: {0, 0, 0, 0}, port: 4000],
|
||||||
debug_errors: true,
|
debug_errors: true,
|
||||||
code_reloader: true,
|
code_reloader: true,
|
||||||
check_origin: false,
|
check_origin: false,
|
||||||
|
|
Loading…
Reference in a new issue