add exceptions for finished games
This commit is contained in:
parent
5e471f5c2c
commit
be70ee7330
|
@ -26,6 +26,11 @@ type Push struct {
|
|||
UpdateId string
|
||||
}
|
||||
|
||||
const (
|
||||
GameFinalCode = 4200
|
||||
GameUnavailableCode = 4400
|
||||
)
|
||||
|
||||
type GamedayWebsocket struct {
|
||||
baseURL url.URL
|
||||
*websocket.Conn
|
||||
|
|
|
@ -88,7 +88,7 @@ func subscribe(cmd *cobra.Command, args []string) {
|
|||
|
||||
var p statsapi.Push
|
||||
err = ws.ReadJSON(&p)
|
||||
if websocket.IsUnexpectedCloseError(err) {
|
||||
if websocket.IsUnexpectedCloseError(err, statsapi.GameFinalCode, statsapi.GameUnavailableCode) {
|
||||
log.Println(err)
|
||||
ws.Close()
|
||||
|
||||
|
|
Loading…
Reference in New Issue