Skip to content
This repository has been archived by the owner on Jan 10, 2023. It is now read-only.

Commit

Permalink
Fix short circuiting quitelite
Browse files Browse the repository at this point in the history
  • Loading branch information
sargun committed Nov 19, 2018
1 parent 51102f3 commit 453eea5
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion cmd/titus-executor/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"io/ioutil"
"os"
"os/signal"
"strconv"
"time"

"github.com/Netflix/metrics-client-go/metrics"
Expand Down Expand Up @@ -56,6 +57,14 @@ var flags = []cli.Flag{
},
}

func isQuiteliteShortCircuited() (bool, error) {
shortCircuitQuiteLite := os.Getenv("SHORT_CIRCUIT_QUITELITE")
if shortCircuitQuiteLite == "" {
return false, nil
}
return strconv.ParseBool(shortCircuitQuiteLite)
}

func main() {
app := cli.NewApp()
app.Name = "titus-executor"
Expand All @@ -72,7 +81,12 @@ func main() {
}

app.Flags = properties.ConvertFlagsForAltSrc(app.Flags)
app.Before = altsrc.InitInputSourceWithContext(app.Flags, properties.NewQuiteliteSource())

if quiteliteShortCircuited, err := isQuiteliteShortCircuited(); err != nil {
panic(err)
} else if !quiteliteShortCircuited {
app.Before = altsrc.InitInputSourceWithContext(app.Flags, properties.NewQuiteliteSource())
}
if err := app.Run(os.Args); err != nil {
panic(err)
}
Expand Down

0 comments on commit 453eea5

Please sign in to comment.