Fix ctrl-c not working when waiting for initial value on mqtt

This commit is contained in:
andig 2021-10-19 20:03:01 +02:00
parent 496bae9312
commit a924483398

View file

@ -245,7 +245,11 @@ func run(cmd *cobra.Command, args []string) {
<-signalC // wait for signal
close(stopC) // signal loop to end
<-exitC // wait for loop to end
select {
case <-exitC: // wait for loop to end
case <-time.NewTimer(conf.Interval).C: // wait max 1 period
}
os.Exit(1)
}()