Refactor: telemetry sending

- Fix bug where approxNumTorrents and other stats were not refreshed
when getting sent on 12 hour interval
- Lazy require modules
- Move setInterval into renderer/main.js
- Remove low-level https usage, use simple-get
This commit is contained in:
Feross Aboukhadijeh
2016-09-30 22:34:01 -07:00
parent 5ff2d893b9
commit e10a84b294
2 changed files with 31 additions and 48 deletions

View File

@@ -134,6 +134,10 @@ function onState (err, _state) {
function delayedInit () {
telemetry.send(state)
// Send telemetry data every 12 hours, for users who keep the app running
// for extended periods of time
setInterval(() => telemetry.send(state), 12 * 3600 * 1000)
// Warn if the download dir is gone, eg b/c an external drive is unplugged
checkDownloadPath()