Skip to content

Commit

Permalink
keep running on current config if new config is not valid
Browse files Browse the repository at this point in the history
  • Loading branch information
tvidal-net authored and muesli committed Feb 13, 2022
1 parent 8bd45e9 commit e9edb0f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,15 @@ func eventLoop(dev *streamdeck.Device, tch chan interface{}) error {

case <-hup:
verbosef("Received SIGHUP, reloading configuration...")
deck, err = LoadDeck(dev, "", deck.File)

nd, err := LoadDeck(dev, ".", deck.File)
if err != nil {
return err
verbosef("The new configuration is not valid, keeping the current one.")
fmt.Fprintf(os.Stderr, "Configuration Error: %s\n", err)
continue
}

deck = nd
deck.updateWidgets()

case <-sigs:
Expand Down

0 comments on commit e9edb0f

Please sign in to comment.