[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [stem/master] Make `Controller.get_uptime` asynchronous



commit b05a662283397fe0f58986dfda9f087bea3ba159
Author: Illia Volochii <illia.volochii@xxxxxxxxx>
Date:   Wed Apr 15 22:13:53 2020 +0300

    Make `Controller.get_uptime` asynchronous
---
 stem/control.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/stem/control.py b/stem/control.py
index f847207f..0e03edfb 100644
--- a/stem/control.py
+++ b/stem/control.py
@@ -1650,7 +1650,7 @@ class Controller(BaseController):
       raise ValueError("Unable to resolve when tor began" if self.is_localhost() else "Tor isn't running locally")
 
   @with_default()
-  def get_uptime(self, default: Any = UNDEFINED) -> float:
+  async def get_uptime(self, default: Any = UNDEFINED) -> float:
     """
     get_uptime(default = UNDEFINED)
 
@@ -1666,7 +1666,7 @@ class Controller(BaseController):
       was provided
     """
 
-    return time.time() - self.get_start_time()
+    return time.time() - (await self.get_start_time())
 
   def is_user_traffic_allowed(self) -> 'stem.control.UserTrafficAllowed':
     """



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits