when a node asks for tasks, that should count as acitivty
update the client's lastping value when it contacts us
diff --git a/api/pages/node/tasks.py b/api/pages/node/tasks.py
index 44c6aef..626900f 100644
--- a/api/pages/node/tasks.py
+++ b/api/pages/node/tasks.py
@@ -48,6 +48,7 @@
import plugins.registry
import plugins.tasks
import base64
+import time
def run(API, environ, indata, session):
@@ -75,6 +76,10 @@
'name': task.name,
'payload': task.payload
})
+ # Register that the node contacted us - that counts as being alive
+ session.client.lastping = int(time.time())
+ session.client.save()
+
# This is the fun part! Because $design, we have to encrypt using the client's public key!
# This way, only the _true_ client can decrypt it, and no snooping.
plain = json.dumps({