Skip to content

Commit

Permalink
[ga-format-pr] Run go/utils/repofmt/format_repo.sh and go/Godeps/upda…
Browse files Browse the repository at this point in the history
…te.sh
  • Loading branch information
zachmu committed Dec 2, 2023
1 parent f63ad7b commit e05f216
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion go/cmd/dolt/commands/send_metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func GRPCEventRemoteConfigForEnv(dEnv *env.DoltEnv) (dbfactory.GRPCRemoteConfig,
}

insecure, _ := strconv.ParseBool(insecureStr)

hostAndPort := fmt.Sprintf("%s:%d", host, port)
cfg, err := dEnv.GetGRPCDialParams(grpcendpoint.Config{
Endpoint: hostAndPort,
Expand Down
20 changes: 10 additions & 10 deletions go/cmd/dolt/commands/sqlserver/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import (
"strings"
"time"

"github.com/dolthub/dolt/go/libraries/doltcore/dbfactory"
"github.com/dolthub/go-mysql-server/eventscheduler"
"github.com/dolthub/go-mysql-server/server"
"github.com/dolthub/go-mysql-server/sql"
Expand All @@ -44,6 +43,7 @@ import (
"github.com/dolthub/dolt/go/cmd/dolt/commands"
"github.com/dolthub/dolt/go/cmd/dolt/commands/engine"
eventsapi "github.com/dolthub/dolt/go/gen/proto/dolt/services/eventsapi/v1alpha1"
"github.com/dolthub/dolt/go/libraries/doltcore/dbfactory"
"github.com/dolthub/dolt/go/libraries/doltcore/env"
"github.com/dolthub/dolt/go/libraries/doltcore/remotesrv"
"github.com/dolthub/dolt/go/libraries/doltcore/sqle"
Expand Down Expand Up @@ -590,10 +590,10 @@ func (h *heartbeatService) Stop() error { return nil }

func (h *heartbeatService) Run(ctx context.Context) {
// Faulty config settings or disabled metrics can cause us to not have a valid endpoint
if h.cfg.Endpoint == "" {
if h.cfg.Endpoint == "" {
return
}

ticker := time.NewTicker(24 * time.Hour)
defer ticker.Stop()

Expand All @@ -606,22 +606,22 @@ func (h *heartbeatService) Run(ctx context.Context) {
if err != nil {
continue
}

eventEmitter := events.NewGrpcEmitter(conn)
t := events.NowTimestamp()
err = eventEmitter.LogEvents(h.version, []*eventsapi.ClientEvent{
{
Id: uuid.New().String(),
StartTime: t,
EndTime: t,
Type: eventsapi.ClientEventType_SQL_SERVER_HEARTBEAT,
Id: uuid.New().String(),
StartTime: t,
EndTime: t,
Type: eventsapi.ClientEventType_SQL_SERVER_HEARTBEAT,
},
})

if err != nil {
logrus.Debugf("failed to send heartbeat event: %v", err)
}

_ = conn.Close()
}
}
Expand Down

0 comments on commit e05f216

Please sign in to comment.