d2r2 / go-dht

Golang library to interact with DHT11/DHT22/DHT12 temperature and humidity sensors from Raspberry PI.
MIT License
133 stars 52 forks source link

On app termination long output of "2018/10/01 11:18:47 Signal received, cancel context" messages #13

Closed d2r2 closed 5 years ago

d2r2 commented 5 years ago

As @jnovack report, app termination produce long output, which can contains hundreds/thousands of lines:

2018/10/01 11:18:47 Signal received, cancel context
2018/10/01 11:18:47 Signal received, cancel context
2018/10/01 11:18:47 Signal received, cancel context
2018/10/01 11:18:47 Signal received, cancel context

As it found each call to ReadDHTxxWithRetry left goroutine live and running inside of shell.CloseContextOnKillSignal(cancel) waiting for termination event.

d2r2 commented 5 years ago

Issue resolved in pull request #14.