diff options
| author | Mel <einebeere@gmail.com> | 2022-04-08 14:35:47 +0200 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2022-04-08 16:17:10 +0200 |
| commit | f635f32d2b2400f7881d700fa98316fbdb7a694f (patch) | |
| tree | ad0f19a993ecffea3886e78628277dacc40847dc /pkg/discord/gateway/gateway.go | |
| parent | 24f175df385466e04ef21d153713d2ecf3a9733b (diff) | |
| download | jinx-f635f32d2b2400f7881d700fa98316fbdb7a694f.tar.zst jinx-f635f32d2b2400f7881d700fa98316fbdb7a694f.zip | |
Use time.Duration for heartbeats
Diffstat (limited to 'pkg/discord/gateway/gateway.go')
| -rw-r--r-- | pkg/discord/gateway/gateway.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/pkg/discord/gateway/gateway.go b/pkg/discord/gateway/gateway.go index 18cf708..d1311c2 100644 --- a/pkg/discord/gateway/gateway.go +++ b/pkg/discord/gateway/gateway.go @@ -7,6 +7,7 @@ import ( "jinx/pkg/discord/events" "jinx/pkg/libs/cancellablewebsocket" "net/http" + "time" "github.com/gorilla/websocket" "github.com/rs/zerolog" @@ -62,7 +63,8 @@ func (g *GatewayImpl) Start(ctx context.Context, url string, token string) error return err } - g.heartbeat.Start(ctx, hello.HeartbeatInterval) + heartbeatInterval := time.Duration(hello.HeartbeatInterval) * time.Millisecond + g.heartbeat.Start(ctx, heartbeatInterval) if err = g.identify(token); err != nil { return err |
