Attempt to track the disconnect bug

This commit is contained in:
zikaeroh 2020-06-12 21:16:24 -07:00
parent 6566ae22fd
commit c16062ae40
3 changed files with 9 additions and 1 deletions

View File

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

View File

@ -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.",
})
)

View File

@ -297,6 +297,7 @@ func (r *Room) HandleConn(playerID uuid.UUID, nickname string, c *websocket.Conn
metricReceived.Inc()
if err := r.handleNote(playerID, &note); err != nil {
metricHandleErrors.Inc()
log.Println("error handling note:", err)
return err
}