Skip to content

Commit

Permalink
fix: read config on each loop
Browse files Browse the repository at this point in the history
  • Loading branch information
biodrone committed Mar 27, 2024
1 parent 99578e3 commit d3b398f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion streamdl.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func main() {
var ticker = time.NewTicker(time.Second * time.Duration(*tickTime))
var config []Config
confErr := yaml.Unmarshal(readConfig(*confLoc), &config)
control := make(chan bool, len(config[0].Streamers))
control := make(chan bool, len(config[0].Streamers)) //might need to move these into the main loop
response := make(chan bool, len(config[0].Streamers))
ll, err := log.ParseLevel(os.Getenv("LOG_LEVEL"))

Expand Down Expand Up @@ -60,6 +60,12 @@ func main() {
}()

for {
//Update config for each tick
confErr := yaml.Unmarshal(readConfig(*confLoc), &config)
if confErr != nil {
log.Fatalf("Config Error: %v", confErr)
}

for _, site := range config {
for _, streamer := range site.Streamers {
_, exists := urls[streamer.User]
Expand Down

0 comments on commit d3b398f

Please sign in to comment.