This PR fixes #27 by checking Internet connectivity in a background thread and setting a static variable. This variable is then checked before doing a request via feedparser.parse(feed_url), meaning that no work is being done while being offline. feed.status is guarded by a try block, since there is no guarantee that ConnectivityThread.isConnected is accurate while feedparser.parse is fetching a resource.
Queuing ConnectivityThread with GithubFeedUpdatherThread, might be able to guarantee connectivity while running feedparser.parse(feed_url).
This adds a little more complexity to github-notifier, but is more efficient that PR #28. However, I'm not sure the increased complexity is worth it, in this case.
Seems like this will have to be rebased on #28, right? Otherwise looks good to me. I'm assuming the connectivity thread commit will be removed here as well since you removed it from #28 too?
This PR fixes #27 by checking Internet connectivity in a background thread and setting a static variable. This variable is then checked before doing a request via
feedparser.parse(feed_url)
, meaning that no work is being done while being offline.feed.status
is guarded by a try block, since there is no guarantee thatConnectivityThread.isConnected
is accurate whilefeedparser.parse
is fetching a resource.Queuing
ConnectivityThread
withGithubFeedUpdatherThread
, might be able to guarantee connectivity while runningfeedparser.parse(feed_url)
.This adds a little more complexity to github-notifier, but is more efficient that PR #28. However, I'm not sure the increased complexity is worth it, in this case.
It also adds a debug log level.