Skip to content

Commit

Permalink
fix(nodebuilder): fix error log and shut the fx
Browse files Browse the repository at this point in the history
  • Loading branch information
Wondertan committed May 3, 2023
1 parent 4d31ad4 commit 2ddc9f8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions logs/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ func SetAllLoggers(level logging.LogLevel) {
_ = logging.SetLogLevel("net/identify", "ERROR")
_ = logging.SetLogLevel("shrex/nd", "WARN")
_ = logging.SetLogLevel("shrex/eds", "WARN")
_ = logging.SetLogLevel("fx", "FATAL")
}

func SetDebugLogging() {
Expand Down
6 changes: 3 additions & 3 deletions nodebuilder/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"github.com/celestiaorg/celestia-node/nodebuilder/state"
)

var Timeout = time.Second * 30
var Timeout = time.Minute * 2

var (
log = logging.Logger("node")
Expand Down Expand Up @@ -100,7 +100,7 @@ func (n *Node) Start(ctx context.Context) error {
if err != nil {
log.Debugf("error starting %s Node: %s", n.Type, err)
if errors.Is(err, context.DeadlineExceeded) {
return fmt.Errorf("node: failed to start within timeout(%s): %w", Timeout, errors.Unwrap(err))
return fmt.Errorf("node: failed to start within timeout(%s): %w", Timeout, err)
}
return fmt.Errorf("node: failed to start: %w", err)
}
Expand Down Expand Up @@ -145,7 +145,7 @@ func (n *Node) Stop(ctx context.Context) error {
if err != nil {
log.Debugf("error stopping %s Node: %s", n.Type, err)
if errors.Is(err, context.DeadlineExceeded) {
return fmt.Errorf("node: failed to stop within timeout(%s): %w", Timeout, errors.Unwrap(err))
return fmt.Errorf("node: failed to stop within timeout(%s): %w", Timeout, err)
}
return fmt.Errorf("node: failed to stop: %w", err)
}
Expand Down

0 comments on commit 2ddc9f8

Please sign in to comment.