Skip to content

Commit

Permalink
feat: use token from env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
andrasbacsai committed Jun 18, 2024
1 parent 6c4f859 commit f2f6faf
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cmd/sentinel/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/gin-gonic/gin"
)

var version string = "0.0.5"
var version string = "0.0.7"
var logsDir string = "/app/logs"
var metricsDir string = "/app/metrics"
var cpuMetricsFile string = metricsDir + "/cpu.csv"
Expand Down Expand Up @@ -61,6 +61,13 @@ func main() {
flag.IntVar(&metricsHistoryInMinutes, "metrics-history", metricsHistoryInMinutes, "Metrics history in minutes. Default is 43200 minutes (30 days)")
flag.BoolVar(&startScheduler, "scheduler", false, "Start scheduler that collects metrics / data. Default is false.")
flag.Parse()

if os.Getenv("TOKEN") != "" {
tokenFromEnv := os.Getenv("TOKEN")
if tokenFromEnv != "" {
token = tokenFromEnv
}
}
if os.Getenv("SCHEDULER") == "true" {
startScheduler = true
}
Expand Down

0 comments on commit f2f6faf

Please sign in to comment.