[geary/wip/460-offline-after-hibernate] Use monotonic time for ConnectivityManager's interval check
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/wip/460-offline-after-hibernate] Use monotonic time for ConnectivityManager's interval check
- Date: Wed, 24 Jul 2019 07:50:13 +0000 (UTC)
commit 405454bdc293cb93db4b82662f20139205630887
Author: Michael Gratton <mike vee net>
Date: Wed Jul 24 17:47:50 2019 +1000
Use monotonic time for ConnectivityManager's interval check
As a result after resuming from sleep/hibernate the timed check won't
necessarily occur immediatly, reducing spurious offline notifications.
src/engine/util/util-connectivity-manager.vala | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/engine/util/util-connectivity-manager.vala b/src/engine/util/util-connectivity-manager.vala
index 9dc0f068..e1675077 100644
--- a/src/engine/util/util-connectivity-manager.vala
+++ b/src/engine/util/util-connectivity-manager.vala
@@ -111,7 +111,7 @@ public class Geary.ConnectivityManager : BaseObject {
this.remote, cancellable
);
this.next_check = (
- GLib.get_real_time() + (CHECK_QUIESCENCE_MS * 1000)
+ GLib.get_monotonic_time() + (CHECK_QUIESCENCE_MS * 1000)
);
} catch (GLib.IOError.CANCELLED err) {
// User cancelled, so leave as unreachable
@@ -219,7 +219,7 @@ public class Geary.ConnectivityManager : BaseObject {
// issue in Bug 776042.
if (this.is_reachable.is_uncertain() ||
this.existing_check != null ||
- this.next_check <= GLib.get_real_time()) {
+ this.next_check <= GLib.get_monotonic_time()) {
this.check_reachable.begin();
} else if (!this.delayed_check.is_running) {
this.delayed_check.start();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]