Skip to content

Commit

Permalink
feat: node replace arguments & export node special execution log path…
Browse files Browse the repository at this point in the history
… environment
  • Loading branch information
halalala222 committed Aug 16, 2024
1 parent d00a678 commit e2957f6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions internal/dag/scheduler/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"bytes"
"context"
"fmt"
"github.com/daguflow/dagu/internal/constants"
"io"
"log"
"os"
Expand Down Expand Up @@ -359,6 +360,9 @@ func (n *Node) setupLog() error {
n.logLock.Lock()
defer n.logLock.Unlock()
var err error
if err = os.Setenv(util.GenerateStepSpecialExecutionLogPathKey(n.id), n.data.State.Log); err != nil {
return err
}
n.logFile, err = util.OpenOrCreateFile(n.data.State.Log)
if err != nil {
n.data.State.Error = err
Expand Down Expand Up @@ -432,6 +436,14 @@ func (n *Node) init() {
return
}
n.id = getNextNodeID()
n.data.Step.NodeID = n.id

n.data.Step.CmdWithArgs = strings.ReplaceAll(
n.data.Step.CmdWithArgs,
constants.StepDaguExecutionLogPathKeySuffix,
util.GenerateStepSpecialExecutionLogPathKey(n.id),
)

if n.data.Step.Variables == nil {
n.data.Step.Variables = []string{}
}
Expand Down

0 comments on commit e2957f6

Please sign in to comment.