Skip to content

Commit

Permalink
added startup-delay
Browse files Browse the repository at this point in the history
  • Loading branch information
billettc committed Sep 3, 2024
1 parent 22240ed commit 53e2b4a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/honey-tracker/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"fmt"
"os"
"time"

"github.com/spf13/cobra"
"github.com/streamingfast/bstream"
Expand Down Expand Up @@ -34,6 +35,7 @@ func init() {
RootCmd.Flags().String("db-name", "postgres", "PostgreSQL database name")
RootCmd.Flags().Uint64("start-block", 0, "start block number (0 means no start block)")
RootCmd.Flags().Uint64("stop-block", 0, "stop block number (0 means no stop block)")
RootCmd.Flags().Duration("startup-delay", time.Duration(0), "stop block number (0 means no stop block)")

// Manifest
RootCmd.Flags().String("output-module-type", "proto:hivemapper.types.v1.Output", "Expected output module type")
Expand All @@ -45,6 +47,10 @@ func rootRun(cmd *cobra.Command, args []string) error {
return fmt.Errorf("missing SUBSTREAMS_API_TOKEN environment variable")
}

if sflags.MustGetDuration(cmd, "startup-delay") != time.Duration(0) {
time.Sleep(sflags.MustGetDuration(cmd, "startup-delay"))
}

logger, tracer := logging.ApplicationLogger("honey-tracker", "honey-tracker")

endpoint := args[0]
Expand Down

0 comments on commit 53e2b4a

Please sign in to comment.