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):
def __unicode__(self):
return self.name
@method_cache(10, 5)
@method_cache(10)
def get_online(self):
"""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:
return self.remote_query(vm_tasks.ping, timeout=1, default=False)
except WorkerNotFound:
self.get_remote_queue_name("vm")
except:
return False
else:
return True
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