Attempt to track the disconnect bug
This commit is contained in:
parent
6566ae22fd
commit
c16062ae40
|
@ -56,7 +56,7 @@ function usePlayer(playerID: string, state?: State): { pState: StatePlayer; pTea
|
||||||
}, [playerID, state]);
|
}, [playerID, state]);
|
||||||
}
|
}
|
||||||
|
|
||||||
const reconnectAttempts = 5;
|
const reconnectAttempts = 2;
|
||||||
|
|
||||||
function useWS(roomID: string, playerID: string, nickname: string, dead: () => void, onOpen: () => void) {
|
function useWS(roomID: string, playerID: string, nickname: string, dead: () => void, onOpen: () => void) {
|
||||||
const didUnmount = React.useRef(false);
|
const didUnmount = React.useRef(false);
|
||||||
|
|
|
@ -33,4 +33,11 @@ var (
|
||||||
Name: "sent_total",
|
Name: "sent_total",
|
||||||
Help: "Total number of sent messages.",
|
Help: "Total number of sent messages.",
|
||||||
})
|
})
|
||||||
|
|
||||||
|
metricHandleErrors = promauto.NewCounter(prometheus.CounterOpts{
|
||||||
|
Namespace: "codies",
|
||||||
|
Subsystem: "codies",
|
||||||
|
Name: "handle_error_total",
|
||||||
|
Help: "Total number of handle errors.",
|
||||||
|
})
|
||||||
)
|
)
|
||||||
|
|
|
@ -297,6 +297,7 @@ func (r *Room) HandleConn(playerID uuid.UUID, nickname string, c *websocket.Conn
|
||||||
metricReceived.Inc()
|
metricReceived.Inc()
|
||||||
|
|
||||||
if err := r.handleNote(playerID, ¬e); err != nil {
|
if err := r.handleNote(playerID, ¬e); err != nil {
|
||||||
|
metricHandleErrors.Inc()
|
||||||
log.Println("error handling note:", err)
|
log.Println("error handling note:", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue