Skip to content

Commit

Permalink
Add a time.Sleep before reconnecting the indexer
Browse files Browse the repository at this point in the history
  • Loading branch information
m-Peter committed Jan 6, 2024
1 parent f55dc7b commit b7fa216
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions cmd/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"flag"
"fmt"
"runtime"
"time"

goGrpc "google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
Expand Down Expand Up @@ -85,6 +86,7 @@ func runIndexer(ctx context.Context, store *storage.Store, logger zerolog.Logger

reconnect := func(height uint64) {
logger.Warn().Msgf("Reconnecting at block height: %d", height)
time.Sleep(10 * time.Second)

var err error
flowClient, err := grpc.NewBaseClient(
Expand Down

0 comments on commit b7fa216

Please sign in to comment.