Add forceOutput parameter to yaml
This commit is contained in:
parent
622e9fbc0f
commit
dd3c3eeb85
@ -48,6 +48,7 @@ type Task struct {
|
|||||||
Deadline uint32 `yaml:"deadline"`
|
Deadline uint32 `yaml:"deadline"`
|
||||||
UseSystemEnv *bool `yaml:"useSystemEnv,omitempty"`
|
UseSystemEnv *bool `yaml:"useSystemEnv,omitempty"`
|
||||||
ConcurrencyPolicy string `yaml:"concurrencyPolicy"`
|
ConcurrencyPolicy string `yaml:"concurrencyPolicy"`
|
||||||
|
ForceOutput *bool `yaml:"forceOutput,omitempty"`
|
||||||
|
|
||||||
// internal values
|
// internal values
|
||||||
envVars []string
|
envVars []string
|
||||||
@ -143,7 +144,11 @@ func (t *Task) Run() {
|
|||||||
select {
|
select {
|
||||||
case err := <-execution.stop:
|
case err := <-execution.stop:
|
||||||
if err == nil {
|
if err == nil {
|
||||||
log.Infof("[%-20s][%d] SUCCESS, took %v", t.Name, execution.id, time.Since(execution.time))
|
if t.ForceOutput != nil && *(t.ForceOutput) == true {
|
||||||
|
log.Infof("[%-20s][%d] SUCCESS, took %v, output: %s", t.Name, execution.id, time.Since(execution.time), t.buf.String())
|
||||||
|
} else {
|
||||||
|
log.Infof("[%-20s][%d] SUCCESS, took %v", t.Name, execution.id, time.Since(execution.time))
|
||||||
|
}
|
||||||
log.Debugf("[%-20s][%d] SUCCESS, output: %s", t.Name, execution.id, t.buf.String())
|
log.Debugf("[%-20s][%d] SUCCESS, output: %s", t.Name, execution.id, t.buf.String())
|
||||||
} else {
|
} else {
|
||||||
log.Infof("[%-20s][%d] ERROR, took %v, err: %v, output: %s", t.Name, execution.id, time.Since(execution.time), err, t.buf.String())
|
log.Infof("[%-20s][%d] ERROR, took %v, err: %v, output: %s", t.Name, execution.id, time.Since(execution.time), err, t.buf.String())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user