Fix ctrl-c not working when waiting for initial value on mqtt
This commit is contained in:
parent
496bae9312
commit
a924483398
1 changed files with 5 additions and 1 deletions
|
|
@ -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)
|
||||
}()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue