Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Master2Develop #104

Merged
merged 4 commits into from
Aug 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions utils/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,12 @@ func RunTracedCmd(

// thresholdTime > 0 continuous report
// thresholdLines > 0 bootstrapping
func RunContinuousCmd(fn func(chunk string) error, command string, thresholdTime int, thresholdLines int) (int, error) {
func RunContinuousCmd(
report func(chunk string) error,
command string,
thresholdTime int,
thresholdLines int) (int, error) {

log.Debug("RunContinuousCmd")

// Saves script/command in a temp file
Expand Down Expand Up @@ -298,7 +303,7 @@ func RunContinuousCmd(fn func(chunk string) error, command string, thresholdTime
nLines++
nTime = int(time.Since(timeStart).Seconds())
if (thresholdTime > 0 && nTime >= thresholdTime) || (thresholdLines > 0 && nLines >= thresholdLines) {
if err := fn(chunk); err == nil {
if reportErr := report(chunk); reportErr == nil {
chunk = ""
}
nLines, nTime = 0, 0
Expand All @@ -313,7 +318,7 @@ func RunContinuousCmd(fn func(chunk string) error, command string, thresholdTime

if len(chunk) > 0 {
log.Debug("Processing the last pending chunk")
if err := fn(chunk); err != nil {
if err := report(chunk); err != nil {
log.Error("Cannot process the last chunk", err.Error())
}
}
Expand Down
2 changes: 1 addition & 1 deletion utils/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
package utils

// VERSION sets the current CLI version
const VERSION = "0.15.0-alpha.1"
const VERSION = "0.15.0"

// VERSION_API_USER_MODE sets the current IMCO API version for user mode
const VERSION_API_USER_MODE = "v3"