Skip to content

Commit

Permalink
feat: add generate step special execution log path key function
Browse files Browse the repository at this point in the history
  • Loading branch information
halalala222 committed Aug 16, 2024
1 parent f9e13bb commit 198573b
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions internal/util/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@ import (
"os"
"path/filepath"
"regexp"
"strconv"
"strings"
"time"

"github.com/mattn/go-shellwords"

"github.com/daguflow/dagu/internal/constants"
)

var (
Expand Down Expand Up @@ -225,3 +228,21 @@ func AddYamlExtension(file string) string {
}
return file
}

func GenerateStepSpecialExecutionLogPathKey(stepID int) string {
var (
keyBuilder = strings.Builder{}
)

keyBuilder.WriteString(constants.StepDaguExecutionLogPathKeyPrefix)

keyBuilder.WriteString("_")

keyBuilder.WriteString(strconv.Itoa(stepID))

keyBuilder.WriteString("_")

keyBuilder.WriteString(constants.StepDaguExecutionLogPathKeySuffix)

return keyBuilder.String()
}

0 comments on commit 198573b

Please sign in to comment.