Commit 1db410a2 by Guba Sándor Committed by Őry Máté

node: rework node online checking function

fixes #102
parent 0c3be3e9
...@@ -66,16 +66,18 @@ class Node(TimeStampedModel): ...@@ -66,16 +66,18 @@ class Node(TimeStampedModel):
def __unicode__(self): def __unicode__(self):
return return
@method_cache(10, 5) @method_cache(10)
def get_online(self): def get_online(self):
"""Check if the node is online. """Check if the node is online.
Runs a remote ping task if the worker is running. Check if node is online by queue is available.
""" """
try: try:
return self.remote_query(, timeout=1, default=False) self.get_remote_queue_name("vm")
except WorkerNotFound: except:
return False return False
return True
online = property(get_online) online = property(get_online)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment