Fix ping on reconnect

This commit is contained in:
Chris McCord 2022-02-10 13:40:58 -05:00
parent 95c69a4aa5
commit 409431b1e7
2 changed files with 5 additions and 1 deletions

View file

@ -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()

View file

@ -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,