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]);
|
||||
}
|
||||
|
||||
const reconnectAttempts = 5;
|
||||
const reconnectAttempts = 2;
|
||||
|
||||
function useWS(roomID: string, playerID: string, nickname: string, dead: () => void, onOpen: () => void) {
|
||||
const didUnmount = React.useRef(false);
|
||||
|
|
|
@ -33,4 +33,11 @@ var (
|
|||
Name: "sent_total",
|
||||
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()
|
||||
|
||||
if err := r.handleNote(playerID, ¬e); err != nil {
|
||||
metricHandleErrors.Inc()
|
||||
log.Println("error handling note:", err)
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue