Skip to content

Commit

Permalink
Merge branch 'main' into release/v0.1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
ItayLevyOfficial committed Oct 9, 2023
2 parents a109147 + 1e6decd commit fc280ff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/utils/bash_commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ import (
"github.com/dymensionxyz/roller/config"
)

// TODO: should accept a context and cancel the command if the context is cancelled
func RunCommandEvery(ctx context.Context, command string, args []string, intervalSec int, options ...CommandOption) {
go func() {
for {
cmd := exec.CommandContext(ctx, command, args...)
for _, option := range options {
option(cmd)
}
_, err := ExecBashCommandWithStdout(cmd)
err := cmd.Run()

if err != nil {
cmd.Stderr.Write([]byte(fmt.Sprintf("Failed to execute command: %s, err: %s\n", cmd.String(), err)))
}
Expand Down

0 comments on commit fc280ff

Please sign in to comment.