Check network status with NetworkManager before doing background updates.
commit85952e03ff8e79219772f62a492783f1b691e512
authorThomas Leonard <talex5@gmail.com>
Sun, 27 Apr 2008 10:09:52 +0000 (27 11:09 +0100)
committerThomas Leonard <talex5@gmail.com>
Sun, 27 Apr 2008 10:16:55 +0000 (27 11:16 +0100)
tree5e061726019abab72c7fa529163737e7fc81226d
parentb33f28ac37b36d688f421ea574ea07a155559f6c
Check network status with NetworkManager before doing background updates.

The logic is:

- If we're on-line, check right away.

- Otherwise (offline, connecting, unknown), sleep for 20 seconds and if
  we're not offline at the end, go ahead.

This is designed to prevent two problems:

- You log in. 0launch tries to check for updates to everything in your session
  while you're still connecting. These things therefore never get updated.

- You're offline, but 0launch displays notifications about failing to update
  from time-to-time.

If you don't use NetworkManager, then the effect of this is to always delay
updates by 20 seconds, which shouldn't cause any problems.
tests/my_dbus.py
tests/testdownload.py
zeroinstall/injector/background.py